-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
112 lines (105 loc) · 2.87 KB
/
docker-compose.yml
File metadata and controls
112 lines (105 loc) · 2.87 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
services:
postgres:
image: pgvector/pgvector:pg17
container_name: mathitem-postgres
restart: unless-stopped
environment:
POSTGRES_DB: mathitem
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init-extensions.sql:/docker-entrypoint-initdb.d/init-extensions.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d mathitem"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- math-item-os
redis:
image: redis:7
container_name: mathitem-redis
restart: unless-stopped
ports:
- "6379:6379"
networks:
- math-item-os
meilisearch:
image: getmeili/meilisearch:v1.12
container_name: mathitem-meilisearch
restart: unless-stopped
environment:
MEILI_MASTER_KEY: mathitem-dev-master-key
MEILI_ENV: development
ports:
- "7700:7700"
networks:
- math-item-os
judge0-server:
image: judge0/judge0:1.13.1
container_name: mathitem-judge0
restart: unless-stopped
ports:
- "2358:2358"
env_file: ./docker/judge0/judge0.conf
depends_on:
judge0-redis:
condition: service_healthy
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:2358/about"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- math-item-os
# wait=true 모드에서 API 서버가 perform_now로 isolate를 직접 실행하므로
# 워커와 동일한 namespace 권한이 필요하다.
privileged: true
security_opt:
- apparmor=unconfined
- seccomp=unconfined
judge0-workers:
image: judge0/judge0:1.13.1
container_name: mathitem-judge0-workers
restart: unless-stopped
command: ["./scripts/workers"]
env_file: ./docker/judge0/judge0.conf
depends_on:
judge0-server:
condition: service_healthy
networks:
- math-item-os
# isolate 샌드박스가 cgroup/namespace를 사용하므로 필수.
# 운영 환경에서는 별도 VM 또는 gVisor 격리를 권장.
privileged: true
# Ubuntu 24.04+ 호스트(Colima VM)의 AppArmor가 unprivileged_userns 프로필로
# isolate의 mount를 차단하므로 필수. seccomp도 함께 해제.
security_opt:
- apparmor=unconfined
- seccomp=unconfined
judge0-redis:
image: redis:7
container_name: mathitem-judge0-redis
restart: unless-stopped
command: ["redis-server", "--port", "6380"]
ports:
- "6380:6380"
healthcheck:
test: ["CMD", "redis-cli", "-p", "6380", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- math-item-os
volumes:
postgres_data:
networks:
math-item-os:
name: math-item-os