Skip to content

Commit 9b67930

Browse files
committed
Add docker compose networking
1 parent 2bb62d5 commit 9b67930

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

docker-compose.dev.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,13 @@ services:
2828
collab-service:
2929
build:
3030
target: dev
31+
32+
# access RedisInsight at http://localhost:5540
33+
# connect to redis on redis insight at redis:6379
34+
redisinsight:
35+
image: redis/redisinsight:latest
36+
restart: always
37+
ports:
38+
- $REDIS_INSIGHT_PORT:$REDIS_INSIGHT_PORT # Expose RedisInsight UI on port 5540
39+
depends_on:
40+
- redis

docker-compose.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ services:
77
- API_GATEWAY_PORT=$API_GATEWAY_PORT
88
environment:
99
- PORT=$FRONTEND_PORT
10+
ports:
11+
- $FRONTEND_PORT:$FRONTEND_PORT
12+
networks:
13+
- hidden
1014

1115
question-service:
1216
build:
@@ -15,6 +19,10 @@ services:
1519
- PORT=$QUESTION_SVC_PORT
1620
- DB_URI=$QUESTION_SVC_DB_URI
1721
- FRONTEND_PORT=$FRONTEND_PORT
22+
ports:
23+
- $QUESTION_SVC_PORT:$QUESTION_SVC_PORT
24+
networks:
25+
- hidden
1826

1927
user-service:
2028
build:
@@ -25,6 +33,10 @@ services:
2533
- JWT_SECRET=$JWT_SECRET
2634
- EMAIL_ADDRESS=$EMAIL_ADDRESS
2735
- EMAIL_PASSWORD=$EMAIL_PASSWORD
36+
ports:
37+
- $USER_SVC_PORT:$USER_SVC_PORT
38+
networks:
39+
- hidden
2840

2941
matching-service:
3042
build:
@@ -35,10 +47,14 @@ services:
3547
- REDIS_PORT=$REDIS_PORT
3648
- QUESTION_SVC_PORT=$QUESTION_SVC_PORT
3749
- COLLAB_SVC_PORT=$COLLAB_SVC_PORT
50+
ports:
51+
- $MATCHING_SVC_PORT:$MATCHING_SVC_PORT
3852
depends_on:
3953
- redis
4054
- question-service
4155
- collab-service
56+
networks:
57+
- hidden
4258

4359
api-gateway:
4460
image: nginx:1.26
@@ -60,22 +76,17 @@ services:
6076
- question-service
6177
- matching-service
6278
- collab-service
79+
networks:
80+
- gateway
81+
- hidden
6382

6483
redis:
6584
image: redis:7.4-alpine
6685
restart: always
6786
ports:
6887
- $REDIS_PORT:$REDIS_PORT
69-
70-
# access RedisInsight at http://localhost:5540
71-
# connect to redis on redis insight at redis:6379
72-
redisinsight:
73-
image: redis/redisinsight:latest
74-
restart: always
75-
ports:
76-
- $REDIS_INSIGHT_PORT:$REDIS_INSIGHT_PORT # Expose RedisInsight UI on port 5540
77-
depends_on:
78-
- redis
88+
networks:
89+
- hidden
7990

8091
collab-service:
8192
build:
@@ -84,3 +95,13 @@ services:
8495
- PORT=$COLLAB_SVC_PORT
8596
- DB_URI=$COLLAB_SVC_DB_URI
8697
- OPENAI_API_KEY=$OPENAI_API_KEY
98+
ports:
99+
- $COLLAB_SVC_PORT:$COLLAB_SVC_PORT
100+
networks:
101+
- hidden
102+
103+
networks:
104+
gateway:
105+
106+
hidden:
107+
internal: true

0 commit comments

Comments
 (0)