skrill-frontend/Dockerfile

35 lines
716 B
Docker
Raw Normal View History

# Stage 1: Build the Angular application
FROM node:alpine AS builder
2024-07-28 03:04:23 -06:00
# Set the working directory
WORKDIR /
2024-07-28 03:04:23 -06:00
# Copy package.json and package-lock.json
2024-07-28 03:04:23 -06:00
COPY package.json package-lock.json ./
# Install dependencies
2024-07-28 03:04:23 -06:00
RUN npm install
# Copy the rest of the application code
COPY . .
COPY dist dist
2024-07-28 03:04:23 -06:00
# Build the application for production
# RUN npm run build:prod
2024-07-28 03:04:23 -06:00
# Stage 2: Serve the application with Nginx
FROM nginx:latest
RUN mkdir /app
# Copy the built application from the builder stage to the Nginx html directory
2024-07-28 11:48:02 -06:00
COPY --from=builder dist/skrill /app
# Copy the custom Nginx configuration file
2024-07-28 11:48:02 -06:00
COPY config/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
2024-07-28 03:04:23 -06:00
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]