From 71667f8948318546358bca6704c11fa61f38d47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Thu, 19 Mar 2026 22:38:00 +0300 Subject: [PATCH] Fix web docker context to support nginx config and shared sounds --- client-web/Dockerfile | 23 ++++++++++++----------- docker/docker-compose.yml | 4 ++-- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/client-web/Dockerfile b/client-web/Dockerfile index cd6cc98..eb19b8a 100644 --- a/client-web/Dockerfile +++ b/client-web/Dockerfile @@ -3,26 +3,27 @@ FROM node:20-alpine AS build WORKDIR /app -# Copy package files -# We use the local package files to avoid workspace hoisting issues in Docker -COPY package.json ./ -# 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 root package.json and lockfile if any +COPY package.json package-lock.json* ./ +COPY client-web/package.json ./client-web/ -# Copy source code -COPY . ./ +# Install dependencies specifically for client-web +RUN npm install + +# Copy source code and shared resources +COPY client-web/ ./client-web/ +COPY shared/ ./shared/ # Build web frontend -RUN npm run build +RUN cd client-web && npm run build # Stage 2: Serve with Nginx FROM nginx:alpine # 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 EXPOSE 80 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index bcb0a8a..9c0afa1 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -48,8 +48,8 @@ services: web: build: - context: ../client-web - dockerfile: Dockerfile + context: .. + dockerfile: client-web/Dockerfile container_name: knot-web restart: always ports: