added dev router t

This commit is contained in:
Louis-Antoine Caron 2024-04-07 13:28:34 -04:00
parent 0f8e1dae39
commit 26986eaf82
6 changed files with 38 additions and 4 deletions

View file

@ -20,7 +20,7 @@ jobs:
- name: Build and Push Docker image for Router - name: Build and Push Docker image for Router
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ./nginx context: ./nginx/prod
file: ./nginx/Dockerfile file: ./nginx/prod/Dockerfile
push: true push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_ROUTER_REPO }}:latest tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_ROUTER_REPO }}:latest

View file

@ -20,7 +20,7 @@ jobs:
- name: Build and Push Docker image for Router - name: Build and Push Docker image for Router
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ./nginx context: ./nginx/dev
file: ./nginx/Dockerfile file: ./nginx/dev/Dockerfile
push: true push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/dev_${{ secrets.DOCKERHUB_ROUTER_REPO }}:latest tags: ${{ secrets.DOCKERHUB_USERNAME }}/dev_${{ secrets.DOCKERHUB_ROUTER_REPO }}:latest

31
nginx/dev/default.conf Normal file
View file

@ -0,0 +1,31 @@
upstream frontend {
server frontend:5174;
}
upstream backend {
server backend:3001;
}
server {
listen 8080;
location /api {
rewrite /backend/(.*) /$1 break;
proxy_pass http://backend;
}
location /socket.io {
rewrite /backend/(.*) /$1 break;
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_hide_header 'Access-Control-Allow-Origin';
}
location / {
proxy_pass http://frontend;
}
}

3
nginx/prod/Dockerfile Normal file
View file

@ -0,0 +1,3 @@
FROM nginx
COPY ./default.conf /etc/nginx/conf.d/default.conf