-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
123 lines (115 loc) · 4.37 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# Define the services and applications that make up your application.
services:
redis:
image: redis:latest
container_name: redis
ports:
- "6379:6379" # Redis default port
healthcheck: # Checks to see if Redis is up
test: ["CMD", "redis-cli", "PING"]
interval: 10s
timeout: 10s
retries: 10
networks:
- app-network
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
ports:
- "5672:5672" # RabbitMQ default port
- "15672:15672" # RabbitMQ management plugin port
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
healthcheck: # Checks to see if RabbitMQ is up
test: rabbitmq-diagnostics check_port_connectivity
interval: 10s
timeout: 10s
retries: 10
networks:
- app-network
user_service:
build: ./backend/user_service # Path to the directory containing the Dockerfile for building the user service image.
ports:
- 5001:5001 # Maps port 5001 on the host to port 5001 in the container, making the app accessible on the host.
networks:
- app-network
question_service:
build:
context: ./backend/question_service # Path to the directory containing the Dockerfile for building the question service image.
args:
USER_SERVICE_BACKEND_URL: ${USER_SERVICE_BACKEND_URL}
ports:
- 5002:5002 # Maps port 5002 on the host to port 5002 in the container, making the app accessible on the host.
networks:
- app-network
depends_on:
- user_service
matching_service:
build:
context: ./backend/matching_service # Path to the directory containing the Dockerfile for building the matching service image.
args:
USER_SERVICE_BACKEND_URL: ${USER_SERVICE_BACKEND_URL}
QUESTION_SERVICE_BACKEND_URL: ${QUESTION_SERVICE_BACKEND_URL}
COLLAB_SERVICE_BACKEND_URL: ${COLLAB_SERVICE_BACKEND_URL}
REDIS_URL: ${REDIS_URL}
RABBITMQ_URL: ${RABBITMQ_URL}
ports:
- 5003:5003 # Maps port 5003 on the host to port 5003 in the container, making the app accessible on the host.
networks:
- app-network
depends_on:
redis:
condition: service_healthy # Only start matching_service when Redis is up
rabbitmq:
condition: service_healthy # Only start matching_service when RabbitMQ is up
user_service:
condition: service_started
question_service:
condition: service_started
collab_service:
condition: service_started
collab_service:
build:
context: ./backend/collab_service # Path to the directory containing the Dockerfile for building the collab service image.
args:
USER_SERVICE_BACKEND_URL: ${USER_SERVICE_BACKEND_URL}
REDIS_URL: ${REDIS_URL}
ports:
- 5004:5004 # Maps port 5004 on the host to port 5004 in the container, making the app accessible on the host.
networks:
- app-network
depends_on:
redis:
condition: service_healthy # Only start collab_service when Redis is up
user_service:
condition: service_started
history_service:
build:
context: ./backend/history_service # Path to the directory containing the Dockerfile for building the history service image.
args:
USER_SERVICE_BACKEND_URL: ${USER_SERVICE_BACKEND_URL}
QUESTION_SERVICE_BACKEND_URL: ${QUESTION_SERVICE_BACKEND_URL}
ports:
- 5005:5005 # Maps port 5005 on the host to port 5005 in the container, making the app accessible on the host.
networks:
- app-network
depends_on:
- user_service
frontend:
build:
context: ./frontend
args:
VITE_QUESTION_SERVICE_BACKEND_URL: ${VITE_QUESTION_SERVICE_BACKEND_URL}
VITE_MATCHING_SERVICE_WS_BACKEND_URL: ${VITE_MATCHING_SERVICE_WS_BACKEND_URL}
VITE_COLLAB_SERVICE_WS_BACKEND_URL: ${VITE_COLLAB_SERVICE_WS_BACKEND_URL}
VITE_COLLAB_SERVICE_BACKEND_URL: ${VITE_COLLAB_SERVICE_BACKEND_URL}
VITE_USER_SERVICE_BACKEND_URL: ${VITE_USER_SERVICE_BACKEND_URL}
VITE_HISTORY_SERVICE_BACKEND_URL: ${VITE_HISTORY_SERVICE_BACKEND_URL}
ports:
- 3000:80
networks:
- app-network
networks:
app-network: # Defines a network named 'app-network'.
driver: bridge # Uses the bridge driver for the network, which is the default and most common network type in Docker.