Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
168 lines (157 loc) · 3.92 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
168 lines (157 loc) · 3.92 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
version: '3.8'
# Định nghĩa cấu hình logging chung để sử dụng lại qua các anchor (<<: *default-logging)
x-logging: &default-logging
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "5"
services:
# --- MODULE 1: HẠ TẦNG CỐT LÕI CỦA ỨNG DỤNG CHÍNH (CODELEARNING WEB APP - DEV) ---
db:
image: postgres:15-alpine
container_name: codelearning-db-dev
restart: always
ports:
- "5432:5432"
env_file:
- ./backend/.env
volumes:
- postgres_data_dev:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}" ]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: codelearning-redis-dev
restart: always
ports:
- "6379:6379"
volumes:
- redis_data_dev:/data
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 5
rabbitmq:
build:
context: ./backend
dockerfile: Dockerfile.rabbitmq
container_name: codelearning-rabbitmq-dev
restart: always
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "-q", "check_running" ]
interval: 10s
timeout: 5s
retries: 5
backend:
profiles:
- backend
build:
context: ./backend
dockerfile: Dockerfile
container_name: codelearning-app-dev
restart: always
ports:
- "8080:8080"
env_file:
- ./backend/.env
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
<<: *default-logging
frontend:
profiles:
- frontend
build:
context: ./frontend
dockerfile: Dockerfile
container_name: codelearning-frontend-dev
restart: always
ports:
- "3000:80"
depends_on:
- backend
<<: *default-logging
# --- MODULE 2: HẠ TẦNG CHẤM BÀI CHUYÊN BIỆT (JUDGE0 SANDBOX - DEV) ---
judge0-server:
profiles:
- judge0
image: judge0/judge0:1.13.1
platform: linux/amd64
container_name: judge0-codelearning-server-dev
env_file: judge0.conf
volumes:
- ./judge0.conf:/judge0.conf:ro
ports:
- "2358:2358"
privileged: true
<<: *default-logging
restart: always
depends_on:
judge0-db:
condition: service_healthy
judge0-redis:
condition: service_healthy
judge0-workers:
profiles:
- judge0
image: judge0/judge0:1.13.1
platform: linux/amd64
container_name: judge0-codelearning-workers-dev
command: [ "./scripts/workers" ]
env_file: judge0.conf
volumes:
- ./judge0.conf:/judge0.conf:ro
privileged: true
<<: *default-logging
restart: always
depends_on:
judge0-db:
condition: service_healthy
judge0-redis:
condition: service_healthy
judge0-db:
profiles:
- judge0
image: postgres:16.2
container_name: judge0-codelearning-db-dev
env_file: judge0.conf
volumes:
- judge0_postgres_data_dev:/var/lib/postgresql/data/
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U judge0 -d judge0" ]
interval: 5s
timeout: 5s
retries: 5
<<: *default-logging
restart: always
judge0-redis:
profiles:
- judge0
image: redis:7.2.4
container_name: judge0-codelearning-redis-dev
command: [ "bash", "-c", 'docker-entrypoint.sh --appendonly no --requirepass "$$REDIS_PASSWORD"' ]
env_file: judge0.conf
healthcheck:
test: [ "CMD-SHELL", "redis-cli -a \"$${REDIS_PASSWORD}\" ping" ]
interval: 5s
timeout: 5s
retries: 5
<<: *default-logging
restart: always
volumes:
postgres_data_dev:
redis_data_dev:
judge0_postgres_data_dev: