Merge pull request #46 from louis-antoine-etsmtl/dev-staging

added dev router t
This commit is contained in:
louis-antoine-etsmtl 2024-04-07 13:29:40 -04:00 committed by GitHub
commit 2fe28753cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 38 additions and 4 deletions

View file

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

View file

@ -20,7 +20,7 @@ jobs:
- name: Build and Push Docker image for Router
uses: docker/build-push-action@v2
with:
context: ./nginx
file: ./nginx/Dockerfile
context: ./nginx/dev
file: ./nginx/dev/Dockerfile
push: true
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