frontend/Dockerfile

28 lines
490 B
Text
Raw Normal View History

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