Skip to content

Commit

Permalink
Merge pull request #57 from KakaoTech-BootCamp-Team-2/dev
Browse files Browse the repository at this point in the history
✅ Test: WebRTC 테스트
  • Loading branch information
sayyyho authored Aug 29, 2024
2 parents 478158d + 547cc4d commit 6f3db80
Show file tree
Hide file tree
Showing 7 changed files with 767 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ jobs:
fi
sudo docker pull ${{ env.DOCKER_IMAGE_NAME }}:latest
sudo docker run --name kaboo-connection-container -d -p 80:80 -e TZ=Asia/Seoul ${{ env.DOCKER_IMAGE_NAME }}:latest
sudo docker image prune -f
sudo docker run --name kaboo-connection-container -d -p 80:80 -p 3000:3000 -e TZ=Asia/Seoul ${{ env.DOCKER_IMAGE_NAME }}:latest
sudo docker image prune -f
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ COPY . .
# Build the application
RUN npm run build

# Production image
# Production image for Nginx
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html

RUN rm /etc/nginx/conf.d/default.conf
COPY ./nginx.conf /etc/nginx/conf.d

# Run Nginx and Node.js server together
EXPOSE 80 3000

# Expose port 80
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
CMD ["sh", "-c", "node /app/server.cjs & nginx -g 'daemon off;'"]
11 changes: 11 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@ server {
listen 80;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

# Proxy WebSocket connections at /video
location /video/ {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Loading

0 comments on commit 6f3db80

Please sign in to comment.