2025-08-25 14:23:55 -07:00
|
|
|
# Build Stage
|
|
|
|
|
FROM node:18 AS build
|
2025-05-07 11:43:44 -07:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2025-08-25 14:23:55 -07:00
|
|
|
COPY package*.json ./
|
|
|
|
|
RUN npm install
|
2025-05-07 11:43:44 -07:00
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
2025-08-25 14:23:55 -07:00
|
|
|
# Serve Stage
|
|
|
|
|
FROM nginx:stable-alpine
|
|
|
|
|
|
|
|
|
|
# Copy built frontend into nginx public folder
|
|
|
|
|
COPY --from=build /app/build /usr/share/nginx/html
|
2025-05-07 11:43:44 -07:00
|
|
|
|
2025-08-25 14:23:55 -07:00
|
|
|
# Remove default Nginx config
|
|
|
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
2025-05-07 11:43:44 -07:00
|
|
|
|
2025-08-25 14:23:55 -07:00
|
|
|
# Add custom Nginx config
|
|
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
2025-05-07 11:43:44 -07:00
|
|
|
|
2025-08-25 14:23:55 -07:00
|
|
|
# Expose port 80 (not 8080 inside container)
|
|
|
|
|
EXPOSE 3000
|
2025-05-07 11:43:44 -07:00
|
|
|
|
2025-08-25 14:23:55 -07:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|