From f5e7c3f90fa506af1dabd7a6847dc83ed0f7a271 Mon Sep 17 00:00:00 2001 From: sayyyho <323psh@naver.com> Date: Fri, 30 Aug 2024 03:42:29 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EC=B5=9C=EC=A2=85=20WebRTC=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 10 +++++----- nginx.conf | 4 +--- src/pages/VideoPage.jsx | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4bf0a9e..0cb2ac2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,20 +12,20 @@ RUN npm install COPY . . # Build the application -RUN npx vite build # 'npx vite build'로 빌드 실행 +RUN npm run build # Production image for Nginx FROM nginx:alpine -# Copy built application -COPY --from=build /app/dist /usr/share/nginx/html - # Install Node.js in Nginx container RUN apk add --no-cache nodejs npm +# Copy built application +COPY --from=build /app/dist /usr/share/nginx/html + # Copy Node.js server files COPY --from=build /app/server.cjs /app/server.cjs -COPY --from=build /app/node_modules /app/node_modules # Ensure node_modules is copied +COPY --from=build /app/node_modules /app/node_modules # Remove default nginx config RUN rm /etc/nginx/conf.d/default.conf diff --git a/nginx.conf b/nginx.conf index 0a1d357..d594b0d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,7 +1,6 @@ server { listen 80; - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; + server_name kaboo.site; location / { root /usr/share/nginx/html; @@ -9,7 +8,6 @@ server { try_files $uri $uri/ /index.html; } - # Proxy WebSocket connections at /socket.io/ location /socket.io/ { proxy_pass http://localhost:3000; proxy_http_version 1.1; diff --git a/src/pages/VideoPage.jsx b/src/pages/VideoPage.jsx index 1ee6981..3d7487d 100644 --- a/src/pages/VideoPage.jsx +++ b/src/pages/VideoPage.jsx @@ -66,7 +66,7 @@ const RTCPage = () => { }; useEffect(() => { - socketRef.current = io("ws://kaboo.site/socket.io/", { + socketRef.current = io("http://kaboo.site", { transports: ["websocket"], });