From d2149bd99f4b4192160b32fc83c0ef91cf8b0cf6 Mon Sep 17 00:00:00 2001 From: Gal Podlipnik Date: Thu, 12 Jun 2025 17:17:10 +0200 Subject: [PATCH] cicd 14 --- frontend/Dockerfile | 1 + frontend/src/lib/socket.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 0359f86..7230b35 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -8,6 +8,7 @@ RUN npm ci COPY . . ENV VITE_API_BASE_URL=/api +ENV VITE_SOCKET_URL=/socket.io RUN npm run build FROM nginx:alpine diff --git a/frontend/src/lib/socket.ts b/frontend/src/lib/socket.ts index d9f88c6..d99657a 100644 --- a/frontend/src/lib/socket.ts +++ b/frontend/src/lib/socket.ts @@ -12,8 +12,9 @@ class SocketService { if (this.socket && this.socket.connected) { return this.socket; } - - this.socket = io('http://localhost:3000', { + const socketUrl = + import.meta.env.VITE_SOCKET_URL || 'http://localhost:3000'; + this.socket = io(socketUrl, { auth: { token, },