-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
65 lines (59 loc) · 1.33 KB
/
docker-compose.prod.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
version: '3.3'
# 18.04 1.17 3.3
# 20.04 19.03 3.8
services:
web:
build:
context: ./app
dockerfile: Dockerfile.prod
command: gunicorn django_tiger.wsgi:application --bind 0.0.0.0:8000
# command: gunicorn django_tiger.wsgi:application
volumes:
- static_volume:/home/app/web/staticfiles
- media_volume:/home/app/web/mediafiles
expose:
- 8000 # 只对docker内开放端口
env_file:
- ./.env.prod
depends_on:
- db
db:
image: postgres:13-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.prod.db
bot:
build:
context: ./bot
command: python cron.py
env_file:
- ./.env.bot
volumes:
- bot_volume:/home/app/web/botfiles
redis:
image: redis:alpine
volumes:
- redis_data:/data
command:
redis-server --appendonly yes
nginx:
build:
context: ./nginx
dockerfile: Dockerfile.prod
# 参考nginx文件夹里配置的注释来使用
volumes:
- static_volume:/home/app/web/staticfiles
- media_volume:/home/app/web/mediafiles
- bot_volume:/home/app/web/botfiles
ports:
- 80:80
- 443:443
environment:
TZ : 'Asia/Shanghai'
volumes:
postgres_data:
redis_data:
static_volume:
media_volume:
bot_volume: