-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcompose.yaml
More file actions
73 lines (69 loc) · 1.75 KB
/
Copy pathcompose.yaml
File metadata and controls
73 lines (69 loc) · 1.75 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
name: coursemc
services:
web:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
env_file:
- ${COURSEMC_ENV_FILE:-.env}
volumes:
- ./data/database:/data
- ./data/backups:/backups
- ./data/static:/app/staticfiles
- ./data/media:/app/media
- ./data/private_media:/app/private_media
expose:
- "8000"
healthcheck:
test:
- CMD
- python
- -c
- >-
import urllib.request;
request = urllib.request.Request(
'http://127.0.0.1:8000/ready/',
headers={'X-Forwarded-Proto': 'https'}
);
urllib.request.urlopen(request, timeout=5).read()
interval: 20s
timeout: 8s
retries: 5
start_period: 60s
networks:
- backend
nginx:
image: nginx:1.28-alpine
restart: unless-stopped
depends_on:
web:
condition: service_healthy
ports:
- "80:80"
- "443:443"
volumes:
- ./runtime/nginx:/etc/nginx/conf.d:ro
- ./data/static:/srv/static:ro
- ./data/media:/srv/media:ro
- ./data/certbot/www:/var/www/certbot:ro
- ./data/certbot/conf:/etc/letsencrypt:ro
command: >-
/bin/sh -c "while :; do sleep 6h & wait $${!}; nginx -s reload;
done & nginx -g 'daemon off;'"
networks:
- backend
certbot:
image: certbot/certbot:v5.7.0
restart: unless-stopped
profiles:
- https
volumes:
- ./data/certbot/www:/var/www/certbot
- ./data/certbot/conf:/etc/letsencrypt
entrypoint: >-
/bin/sh -c "trap exit TERM; while :; do certbot renew --webroot
--webroot-path=/var/www/certbot --quiet; sleep 12h & wait $${!}; done"
networks:
backend:
driver: bridge