Fix web docker context to support nginx config and shared sounds

This commit is contained in:
Халимов Рустам
2026-03-19 22:38:00 +03:00
parent 17d02beb30
commit 71667f8948
2 changed files with 14 additions and 13 deletions
+12 -11
View File
@@ -3,26 +3,27 @@ FROM node:20-alpine AS build
WORKDIR /app WORKDIR /app
# Copy package files # Copy root package.json and lockfile if any
# We use the local package files to avoid workspace hoisting issues in Docker COPY package.json package-lock.json* ./
COPY package.json ./ COPY client-web/package.json ./client-web/
# If there is a lockfile in apps/web, use it, otherwise use root (but root is workspace, so better not)
# Let's try to generate a clean install
RUN npm install --legacy-peer-deps
# Copy source code # Install dependencies specifically for client-web
COPY . ./ RUN npm install
# Copy source code and shared resources
COPY client-web/ ./client-web/
COPY shared/ ./shared/
# Build web frontend # Build web frontend
RUN npm run build RUN cd client-web && npm run build
# Stage 2: Serve with Nginx # Stage 2: Serve with Nginx
FROM nginx:alpine FROM nginx:alpine
# Copy built assets # Copy built assets
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/client-web/dist /usr/share/nginx/html
# Custom Nginx config to proxy /api and /socket.io to server:3001 # Custom Nginx config from docker/ folder
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
+2 -2
View File
@@ -48,8 +48,8 @@ services:
web: web:
build: build:
context: ../client-web context: ..
dockerfile: Dockerfile dockerfile: client-web/Dockerfile
container_name: knot-web container_name: knot-web
restart: always restart: always
ports: ports: