From 3c46bea2ec81f3e6569e69fba34ed5c64d8f18c8 Mon Sep 17 00:00:00 2001 From: Gal Podlipnik Date: Thu, 12 Jun 2025 17:25:09 +0200 Subject: [PATCH] cicd 15 --- frontend/Dockerfile | 1 - frontend/src/lib/socket.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 7230b35..0359f86 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -8,7 +8,6 @@ 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 3196b44..65afc1a 100644 --- a/frontend/src/lib/socket.ts +++ b/frontend/src/lib/socket.ts @@ -12,8 +12,8 @@ class SocketService { if (this.socket && this.socket.connected) { return this.socket; } - const socketUrl = - import.meta.env.VITE_SOCKET_URL || 'http://localhost:3000'; + const socketUrl = import.meta.env.DEV ? 'http://localhost:3000' : ''; + this.socket = io(socketUrl, { auth: { token,