Skip to content

Commit

Permalink
Fix: 최종 WebRTC 에러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sayyyho committed Aug 29, 2024
1 parent 00b496a commit f5e7c3f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
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;
index index.html index.htm;
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;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/VideoPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const RTCPage = () => {
};

useEffect(() => {
socketRef.current = io("ws://kaboo.site/socket.io/", {
socketRef.current = io("http://kaboo.site", {
transports: ["websocket"],
});

Expand Down

0 comments on commit f5e7c3f

Please sign in to comment.