Skip to content

Commit e310362

Browse files
committed
PEER-254 Refactor env vars
1 parent bbe7cbe commit e310362

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

.env.local

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ COLLAB_EXPRESS_DB_PORT=5434
1010
MATCHING_PGDATA="/data/collab-db"
1111
MATCHING_EXPRESS_DB_PORT=5434
1212

13-
USER_CONTAINER_NAME=user-express
13+
USER_SERVICE_NAME=user-express
1414
USER_EXPRESS_ENV=compose
1515
USER_EXPRESS_PORT=9001
1616

17-
QUESTION_CONTAINER_NAME=question-express
17+
QUESTION_SERVICE_NAME=question-express
1818
QUESTION_EXPRESS_ENV=compose
1919
QUESTION_EXPRESS_PORT=9002
2020

docker-compose.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
services:
44
# Databases
5-
65
user-db:
76
hostname: 'user-db'
87
image: postgres:16.4
@@ -56,6 +55,8 @@ services:
5655
restart: unless-stopped
5756
networks:
5857
- question-db-network
58+
ports:
59+
- 5433:5432
5960
healthcheck:
6061
test: ['CMD-SHELL', 'pg_isready -U peerprep-qn-express -d question']
6162
interval: 10s
@@ -64,17 +65,15 @@ services:
6465
timeout: 10s
6566

6667
# Services
67-
6868
user-service:
6969
image: 'user-express'
70-
container_name: 'user-express'
70+
container_name: '${USER_SERVICE_NAME}'
7171
build:
7272
context: ./backend/user
7373
dockerfile: express.Dockerfile
7474
target: production
7575
args:
7676
# For building with the correct env vars
77-
- env=${USER_EXPRESS_ENV}
7877
- port=${USER_EXPRESS_PORT}
7978
ports:
8079
- '9001:${USER_EXPRESS_PORT}'
@@ -115,7 +114,7 @@ services:
115114
environment:
116115
- VITE_USER_SERVICE=http://${USER_SERVICE_NAME}:${USER_EXPRESS_PORT}
117116
##to remove localhost once integrating question
118-
- VITE_QUESTION_SERVICE=http://localhost:${QUESTION_EXPRESS_PORT}
117+
- VITE_QUESTION_SERVICE=http://host.docker.internal:${QUESTION_EXPRESS_PORT}
119118
- FRONTEND_PORT=${FRONTEND_PORT}
120119
depends_on:
121120
user-service:

0 commit comments

Comments
 (0)