forked from PrairieLearn/PrairieLearn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (98 loc) · 2.25 KB
/
docker-compose.yml
File metadata and controls
106 lines (98 loc) · 2.25 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
services:
pl:
build:
context: .
image: prairielearn/prairielearn:local
working_dir: "/PrairieLearn"
command:
- make
- migrate
- start
volumes:
- course-data:/data1/courses
- /var/run/docker.sock:/var/run/docker.sock
- ${HOME}/pl_ag_jobs:/jobs
- ./secrets/ssh/:/root/.ssh
environment:
- HOST_JOBS_DIR=${HOME}/pl_ag_jobs
- NODE_ENV=production
- CONFIG_FILE_PATH=/run/secrets/pl_config
- PGHOST=postgres
- REDISHOST=redis
healthcheck:
test: curl --fail http://localhost:3000/pl/webhooks/ping || exit 1
interval: 40s
timeout: 30s
retries: 3
start_period: 60s
secrets:
- pl_config
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- internal
- external
deploy:
mode: replicated
replicas: 2
redis:
image: redis:alpine
command: --save 60 1 --loglevel debug
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
volumes:
- redis-data:/data
networks:
- internal
postgres:
image: postgres:16.3-alpine
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=pl
- POSTGRES_DB=pl
- POSTGRES_PASSWORD_FILE=/run/secrets/pg_password
healthcheck:
test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB
interval: 5s
timeout: 10s
retries: 5
start_period: 30s
secrets:
- pg_password
networks:
- internal
backus.mines.edu:
image: nginx:stable-alpine
volumes:
- ./secrets/ssl/backus.mines.edu.key:/etc/ssl/backus.mines.edu.key:ro
- ./secrets/ssl/backus.mines.edu.cert:/etc/ssl/backus.mines.edu.cert:ro
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- "443:443"
- "80:80"
networks:
- external
depends_on:
pl:
condition: service_healthy
volumes:
postgres-data:
redis-data:
course-data:
networks:
internal:
external:
secrets:
pl_config:
file: ./config.json
pg_password:
file: ./secrets/pg_password