You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
972 B

#
# Stage 1: Clone and build the Angular app
#
FROM node:18-alpine AS build
RUN apk add --no-cache git
# Introduce a "cache bust" ARG
ARG CACHEBUST=8
# Some command you always want to re-run
RUN echo "This step should be re-run every time: $CACHEBUST"
# Clone the public frontend repo into /app
RUN git clone https://sinistea.pkmn.cloud/Quildra/OriginDex-FrontEnd.git /app
WORKDIR /app
# Install dependencies
RUN npm install
# Build the Angular app in production mode
# If you're on Angular 14+, you might need: npm run build --configuration production
RUN npm run build_prod
#
# Stage 2: Serve the built Angular app with Nginx
#
FROM nginx:alpine
# Copy the Angular build output into Nginx's html folder
# Adjust the dist folder name if your Angular project is named differently
COPY --from=build /app/dist/origin-dex/browser /usr/share/nginx/html
# Expose port 80 inside the container
EXPOSE 80
# Run Nginx in the foreground
CMD ["nginx", "-g", "daemon off;"]