Skip to content

Commit 79af6c2

Browse files
committed
Add env vars for other services
Signed-off-by: SeeuSim <[email protected]>
1 parent 52d5570 commit 79af6c2

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

.env.local

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,17 @@ QUESTION_EXPRESS_DB_PORT=5433
77
COLLAB_PGDATA="/data/collab-db"
88
COLLAB_EXPRESS_DB_PORT=5434
99

10+
MATCHING_PGDATA="/data/collab-db"
11+
MATCHING_EXPRESS_DB_PORT=5434
12+
1013
USER_EXPRESS_ENV=compose
1114
USER_EXPRESS_PORT=9001
15+
16+
QUESTION_EXPRESS_ENV=compose
17+
QUESTION_EXPRESS_PORT=9002
18+
19+
COLLAB_EXPRESS_ENV=compose
20+
COLLAB_EXPRESS_PORT=9003
21+
22+
MATCHING_EXPRESS_ENV=compose
23+
MATCHING_EXPRESS_PORT=9003

docker-compose.yaml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Command: docker-compose --env-file .env.local up -d
22

33
services:
4+
# Databases
5+
46
user-db:
57
hostname: "user-db"
68
image: postgres:16.4
@@ -15,7 +17,7 @@ services:
1517
- "${USER_EXPRESS_DB_PORT}:5432"
1618
restart: unless-stopped
1719
networks:
18-
- user-network
20+
- user-db-network
1921

2022
collab-db:
2123
hostname: "collab-db"
@@ -27,10 +29,11 @@ services:
2729
- ./backend/collaboration/.env.local
2830
volumes:
2931
- "collab-db-docker:/${COLLAB_PGDATA}"
30-
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql
3132
ports:
3233
- "${COLLAB_EXPRESS_DB_PORT}:5432"
3334
restart: unless-stopped
35+
networks:
36+
- collab-db-network
3437

3538
question-db:
3639
hostname: "question-db"
@@ -42,10 +45,13 @@ services:
4245
- ./backend/question/.env.local
4346
volumes:
4447
- "question-db-docker:${QUESTION_PGDATA}"
45-
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql
4648
ports:
4749
- "${QUESTION_EXPRESS_DB_PORT}:5432"
4850
restart: unless-stopped
51+
networks:
52+
- question-db-network
53+
54+
# Services
4955

5056
user-service:
5157
image: "user-express"
@@ -71,12 +77,16 @@ services:
7177
depends_on:
7278
- user-db
7379
networks:
74-
- user-network
80+
- user-db-network
81+
- user-api-network
7582
entrypoint: ./entrypoint.sh
7683

7784
volumes:
7885
user-service:
79-
86+
question-service:
87+
collab-service:
88+
89+
# Persistent Volumes for Databases
8090
user-db-docker:
8191
external: true
8292
collab-db-docker:
@@ -86,5 +96,18 @@ volumes:
8696

8797

8898
networks:
89-
user-network:
99+
# Isolated API Server Networks
100+
user-db-network:
101+
driver: bridge
102+
question-db-network:
103+
driver: bridge
104+
collab-db-network:
105+
driver: bridge
106+
107+
# View-Controller Networks
108+
user-api-network:
109+
driver: bridge
110+
question-api-network:
111+
driver: bridge
112+
collab-api-network:
90113
driver: bridge

0 commit comments

Comments
 (0)