-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
115 lines (106 loc) · 2.39 KB
/
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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
x-common: &common
env_file:
- .env.prod
restart: unless-stopped
services:
website:
<<: [*common]
container_name: django-template-website
build:
context: .
dockerfile: Dockerfile
# args:
# - SOURCES_MIRROR=mirrors.cloud.tencent.com
# - SECURITY_SOURCE_MIRROR=mirrors.cloud.tencent.com
# - PYPI_MIRROR=https://mirrors.cloud.tencent.com/pypi/simple
image: website
volumes:
- staticfiles-data:/var/www/static
- .:/website
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- internal
command: ./scripts/start_prod_server.sh
celery-worker:
<<: [*common]
container_name: django-template-celery-worker
image: website
volumes:
- .:/website
depends_on:
- website
command: ./scripts/run_celery_worker.sh
celery-beat:
<<: [*common]
container_name: django-template-celery-beat
image: website
volumes:
- .:/website
depends_on:
- website
command: ./scripts/run_celery_beat.sh
proxy:
<<: [*common]
container_name: django-template-proxy
image: nginx:alpine-slim
volumes:
- type: volume
source: staticfiles-data
target: /usr/share/nginx/html/static
read_only: true
volume:
nocopy: true
- type: bind
source: nginx.conf
target: /etc/nginx/conf.d/default.conf
depends_on:
- website
networks:
- internal
- cloudflare-tunnel
pgadmin:
<<: [*common]
container_name: django-template-pgadmin
image: dpage/pgadmin4:latest
depends_on:
- postgres
networks:
- internal
- cloudflare-tunnel
redis:
<<: [*common]
container_name: django-template-redis
image: redis:alpine
healthcheck:
test: "redis-cli ping"
interval: 5s
retries: 20
volumes:
- redis-data:/data
networks:
- internal
postgres:
<<: [*common]
container_name: django-template-postgres
image: postgres:14-alpine
healthcheck:
test: "pg_isready -U postgres"
interval: 5s
retries: 20
volumes:
- postgres-data:/var/lib/postgresql/data/
networks:
- internal
volumes:
staticfiles-data:
postgres-data:
redis-data:
networks:
internal:
internal: true
cloudflare-tunnel:
external: true