This repository was archived by the owner on Apr 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (56 loc) · 1.44 KB
/
docker-compose.yml
File metadata and controls
58 lines (56 loc) · 1.44 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
version: "3.6"
services:
web:
container_name: NKUST_AP_API
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/usr/src/app
environment:
- REDIS_URL=${REDIS_URL}
- NEWS_ADMIN=${NEWS_ADMIN}
- NEWS_ADMIN_ACCOUNT=${NEWS_ADMIN_ACCOUNT}
- NEWS_ADMIN_PASSWORD=${NEWS_ADMIN_PASSWORD}
command: ["gunicorn", "-c", "gunicorn_cfg.py", "web-server:app"]
networks:
- redis-net
- open-net
depends_on:
- redis
redis:
image: "redis:alpine"
command: ["redis-server", "--appendonly", "yes"]
networks:
- redis-net
volumes:
- redis-data:/data
nginx:
image: nginx:latest
restart: unless-stopped
volumes:
- ./nginx/nginx_nkust_api.conf:/etc/nginx/conf.d/nginx_nkust_api.conf
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
ports:
- "80:80"
- "443:443"
networks:
- open-net
depends_on:
- web
- certbot
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
certbot:
image: certbot/certbot
restart: unless-stopped
container_name: certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
redis-net:
open-net:
volumes:
redis-data: