microservices/gameboard-service/Dockerfile

28 lines
493 B
Text
Raw Normal View History

2025-08-25 14:23:55 -07:00
# Build Stage
FROM node:18 AS build
WORKDIR /app
2025-08-25 14:23:55 -07:00
COPY package*.json ./
RUN npm install
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-08-25 14:23:55 -07:00
# Remove default Nginx config
RUN rm /etc/nginx/conf.d/default.conf
2025-08-25 14:23:55 -07:00
# Add custom Nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
2025-08-25 14:23:55 -07:00
# Expose port 80 (not 8080 inside container)
EXPOSE 3000
2025-08-25 14:23:55 -07:00
CMD ["nginx", "-g", "daemon off;"]