This commit is contained in:
Халимов Рустам
2026-03-10 22:00:45 +03:00
parent b4b4b8e0d3
commit be0c3812fc
12 changed files with 232 additions and 46 deletions
+31
View File
@@ -0,0 +1,31 @@
# Stage 1: Build React app
FROM node:20-alpine AS build
WORKDIR /app
# ROOT package.json
COPY package*.json ./
COPY apps/server/package*.json ./apps/server/
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;"]