-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
58 lines (57 loc) · 1.53 KB
/
docker-compose.yaml
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
version: '3'
services:
database:
image: mysql:8.0
container_name: database
environment:
MYSQL_ROOT_PASSWORD: ''
MYSQL_DATABASE: dsbd
MYSQL_USER: dsbd
MYSQL_PASSWORD: ''
TZ: 'Asia/Tokyo'
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
- ./data/mysql-data:/var/lib/mysql
ports:
- 3306:3306
restart: always
wsgi_server:
image: doonoc/dsbd-mgmt:production
container_name: wsgi_server
depends_on:
- database
env_file:
- dsbd.env
ports:
- 8000:8000
restart: always
nginx:
image: nginx:stable
depends_on:
- asgi_server
- wsgi_server
ports:
- 80:80
- 443:443
environment:
DOMAIN: '{DOMAIN}'
volumes:
- ./default.conf:/etc/nginx/conf.d/default.conf.template
- ./data/html:/usr/share/nginx/html
- ./data/letsencrypt-data:/etc/letsencrypt
command: /bin/sh -c "envsubst '$$DOMAIN'< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
restart: always
certbot:
image: certbot/certbot
container_name: certbot
depends_on:
- nginx
environment:
DOMAIN: '{DOMAIN}'
EMAIL: '{EMAIL}'
volumes:
- ./data/html:/usr/share/nginx/html
- ./data/letsencrypt-data:/etc/letsencrypt
- ./log/letsencrypt-log:/var/log/letsencrypt
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
restart: always