-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
116 lines (109 loc) · 2.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
116 lines (109 loc) · 2.83 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
name: opensolve
services:
web:
build:
context: .
dockerfile: Dockerfile
env_file:
- ${OPENSOLVE_ENV_FILE:-./ops/env/dev.env}
environment:
PORT: 3000
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
minio:
condition: service_healthy
ports:
- "3000:3000"
restart: unless-stopped
worker:
build:
context: .
dockerfile: Dockerfile
target: judge-worker
command: ["npm", "run", "judge:worker"]
env_file:
- ${OPENSOLVE_ENV_FILE:-./ops/env/dev.env}
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
minio:
condition: service_healthy
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_DB: opensolve
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -d opensolve -U postgres"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
rabbitmq:
image: rabbitmq:3.13-management
environment:
RABBITMQ_DEFAULT_USER: opensolve
RABBITMQ_DEFAULT_PASS: opensolve
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
minio:
image: minio/minio:RELEASE.2024-12-18T18-10-14Z
command: server /data --console-address ":9001"
env_file:
- ${OPENSOLVE_ENV_FILE:-./ops/env/dev.env}
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-opensolve}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-opensolve-secret}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
minio-mc:
image: minio/mc:RELEASE.2024-12-13T22-19-12Z
depends_on:
minio:
condition: service_healthy
env_file:
- ${OPENSOLVE_ENV_FILE:-./ops/env/dev.env}
environment:
MINIO_BUCKET: ${MINIO_BUCKET:-opensolve-assets}
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-opensolve}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-opensolve-secret}
entrypoint: >
/bin/sh -c "
set -euo pipefail;
echo 'waiting for MinIO...';
until mc alias set local http://minio:9000 \"$$MINIO_ROOT_USER\" \"$$MINIO_ROOT_PASSWORD\" >/dev/null 2>&1; do
sleep 2;
done;
echo 'bucket bootstrap complete';
mc mb --ignore-existing local/$$MINIO_BUCKET;
exit 0;
"
volumes:
postgres-data:
minio-data: