2025-01-04 17:39:34 +01:00
|
|
|
# Build stage of the application
|
2025-01-04 18:38:48 +01:00
|
|
|
FROM node:18-alpine AS build
|
2025-01-04 17:39:34 +01:00
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
2025-01-03 23:24:22 +01:00
|
|
|
RUN npm install
|
2025-01-04 17:39:34 +01:00
|
|
|
COPY . .
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
# Production stage to run the application
|
2025-01-04 22:06:17 +01:00
|
|
|
FROM nginx:stable-alpine AS production
|
2025-01-04 21:39:24 +01:00
|
|
|
COPY --from=build /app/build /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|