Skip to content

Commit 1f3e60a

Browse files
committed
PEER-254: Add update nginx config rto remove placeholder string
1 parent 09178e2 commit 1f3e60a

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

docker-compose.yaml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
networks:
1818
- user-db-network
1919
healthcheck:
20-
test: ["CMD-SHELL", "pg_isready -U peerprep-user-express -d user"]
20+
test: ['CMD-SHELL', 'pg_isready -U peerprep-user-express -d user']
2121
interval: 10s
2222
retries: 5
2323
start_period: 30s
@@ -37,7 +37,7 @@ services:
3737
networks:
3838
- collab-db-network
3939
healthcheck:
40-
test: ["CMD-SHELL", "pg_isready -U peerprep-collab-express -d collab"]
40+
test: ['CMD-SHELL', 'pg_isready -U peerprep-collab-express -d collab']
4141
interval: 10s
4242
retries: 5
4343
start_period: 30s
@@ -57,7 +57,7 @@ services:
5757
networks:
5858
- question-db-network
5959
healthcheck:
60-
test: ["CMD-SHELL", "pg_isready -U peerprep-qn-express -d question"]
60+
test: ['CMD-SHELL', 'pg_isready -U peerprep-qn-express -d question']
6161
interval: 10s
6262
retries: 5
6363
start_period: 30s
@@ -72,7 +72,7 @@ services:
7272
context: ./backend/user
7373
dockerfile: express.Dockerfile
7474
target: production
75-
args:
75+
args:
7676
# For building with the correct env vars
7777
- env=${USER_EXPRESS_ENV}
7878
- port=${USER_EXPRESS_PORT}
@@ -91,7 +91,12 @@ services:
9191
networks:
9292
- user-db-network
9393
- user-api-network
94-
entrypoint: ['/bin/sh', 'entrypoint.sh']
94+
healthcheck:
95+
test: wget --no-verbose --tries=1 --spider http://localhost:9001/health || exit 1
96+
interval: 30s
97+
timeout: 10s
98+
retries: 5
99+
start_period: 5s
95100

96101
# Frontend
97102

@@ -112,18 +117,14 @@ services:
112117
- VITE_USER_SERVICE=http://${USER_SERVICE_NAME}:${USER_EXPRESS_PORT}
113118
- VITE_QUESTION_SERVICE=http://localhost:${QUESTION_EXPRESS_PORT}
114119
- port=${FRONTEND_PORT}
115-
# depends_on:
116-
# - user-service
120+
depends_on:
121+
user-service:
122+
condition: service_healthy
123+
restart: true
117124
networks:
118125
- user-api-network
119126
- question-api-network
120127
- collab-api-network
121-
healthcheck:
122-
test: wget --no-verbose --tries=1 --spider http://localhost:9001/health || exit 1
123-
interval: 30s
124-
timeout: 10s
125-
retries: 5
126-
start_period: 5s
127128

128129
volumes:
129130
# Persistent Volumes for Databases

frontend/nginx.conf.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ server {
77
}
88

99
location /user-service/ {
10+
rewrite ^/user-service(/.*)$ $1 break;
1011
proxy_pass ${VITE_USER_SERVICE};
12+
1113
proxy_set_header Host $host;
1214
proxy_set_header X-Real-IP $remote_addr;
1315
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
1416
proxy_set_header X-Forwarded-Proto $scheme;
1517
}
1618

1719
location /question-service/ {
20+
rewrite ^/question-service(/.*)$ $1 break;
1821
proxy_pass ${VITE_QUESTION_SERVICE};
1922
proxy_set_header Host $host;
2023
proxy_set_header X-Real-IP $remote_addr;

0 commit comments

Comments
 (0)