Files
forkmessager/Dockerfile.web
2026-03-12 01:48:58 +03:00

31 lines
559 B
Docker

# Stage 1: Build React app
FROM node:20-alpine AS build
WORKDIR /app
# ROOT package.json
COPY package*.json ./
COPY apps/web/package*.json ./apps/web/
RUN npm install
# Copy source
COPY . .
# Build web frontend
WORKDIR /app/apps/web
RUN npm run build
# Stage 2: Serve with Nginx
FROM nginx:alpine
# Copy built assets
COPY --from=build /app/apps/web/dist /usr/share/nginx/html
# Custom Nginx config to proxy /api and /socket.io to server:3001
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]