forked from MWATelescope/mwa_trigger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.ssl.init.yml
95 lines (87 loc) · 2.32 KB
/
docker-compose.ssl.init.yml
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
version: "3.8"
services:
db:
image: postgres:12.18
container_name: db-container
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- .env
ports:
- 5432:5432
networks:
- tracet-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 5s
web:
build:
context: .
dockerfile: Dockerfile
args:
SYSTEM_ENV: PRODUCTION
container_name: web-container
volumes:
- .:/app
- static_volume:/app/webapp_tracet/static_host
- media_volume:/app/webapp_tracet/media
- ./logs:/app/logs
ports:
- "8000:8000"
env_file:
- .env
command: [
"sh",
"-c",
"gunicorn webapp_tracet.wsgi:application --bind 0.0.0.0:8000 --error-logfile /app/logs/gunicorn_error.log --access-logfile /app/logs/gunicorn_access.log --workers 8 & sleep 5s && echo 'Starting'
&& tmux new -s kafka -d './kafka_daemon.sh'
&& tmux new -s comet -d 'python3.10 twistd_comet_wrapper.py' && wait",
]
depends_on:
- db
networks:
- tracet-network
nginx:
build: ./nginx
container_name: nginx-container
volumes:
- ./nginx/conf.d.ssl/initial.conf:/etc/nginx/conf.d/default.conf
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
- static_volume:/home/app/staticfiles
- media_volume:/home/app/mediafiles
ports:
- 80:80
depends_on:
- web
networks:
- tracet-network
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
command: certonly --webroot -w /var/www/certbot --force-renewal --email [email protected] -d tracet.duckdns.org --agree-tos
networks:
- tracet-network
autoheal:
image: willfarrell/autoheal
container_name: autoheal
restart: always
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- AUTOHEAL_CONTAINER_LABEL=all
# crontab -e
# 0 5 1 */2 * /usr/bin/docker compose -f docker-compose.ssl.init.yml up certbot
volumes:
postgres_data:
static_volume:
media_volume:
networks:
tracet-network:
driver: bridge