-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-dev.yaml
140 lines (130 loc) · 3.13 KB
/
docker-compose-dev.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
version: "3.8"
services:
nginx:
build:
context: nginx
image: myapp-nginx:${VERSION:-latest}
deploy:
mode: global
resources:
limits:
cpus: "1.0"
memory: 32M
#healthcheck:
# test: ["CMD-SHELL", "curl -sf localhost:80/health-check || exit 1"]
# interval: 10s
# timeout: 10s
# retries: 3
# start_period: 10s
volumes:
#- data_dir:/data
- ${APP_FILES_STATIC:-./app/static}:/data/static
- ${APP_FILES:-./app}:/app
secrets:
- source: cssnr_basic_http_auth
target: /etc/nginx/auth.users
depends_on:
- app
ports:
- "80:80"
app:
build:
context: app
image: myapp-app:${VERSION:-latest}
env_file: settings.env
#command: "sh -c 'python manage.py runserver 0.0.0.0:9000'"
command: "watchmedo auto-restart -d /app -p '*.py;*.html' -R -- gunicorn project.asgi:application -b 0.0.0.0:9000 -w 2 -k uvicorn.workers.UvicornWorker"
#healthcheck:
# test: ["CMD", "curl", "-sf", "http://localhost:9000/app-health-check/"]
# interval: 1m
# timeout: 10s
# retries: 3
# start_period: 10s
deploy:
mode: global
resources:
limits:
cpus: "2.0"
memory: 256M
volumes:
#- data_dir:/data
- ${APP_FILES_STATIC:-./app/static}:/data/static
- ${APP_FILES:-./app}:/app
depends_on:
- redis
worker:
image: myapp-app:${VERSION:-latest}
env_file: settings.env
command: "watchmedo auto-restart -d /app -p '*.py' -R -- celery -A project worker -l INFO -c 4"
deploy:
replicas: 1
resources:
limits:
cpus: "2.0"
memory: 256M
volumes:
#- data_dir:/data
- ${APP_FILES:-./app}:/app
depends_on:
- redis
beat:
image: myapp-app:${VERSION:-latest}
env_file: settings.env
command: "celery -A project beat -l INFO -S django"
deploy:
replicas: 1
depends_on:
- redis
- worker
redis:
image: redis:6-alpine
command: "redis-server --appendonly yes"
deploy:
replicas: 1
resources:
limits:
cpus: "1.0"
memory: 32M
volumes:
- redis_data:/data
redis-commander:
image: ghcr.io/joeferner/redis-commander:latest
environment:
- REDIS_HOSTS=local:redis:6379:0,local:redis:6379:1
- URL_PREFIX=/redis
- TRUST_PROXY=true
deploy:
replicas: 1
depends_on:
- redis
flower:
image: mher/flower
env_file: settings.env
command: "celery flower --enable_events=False --url_prefix=flower"
deploy:
replicas: 1
volumes:
- flower_data:/data
depends_on:
- app
- redis
- worker
phpmyadmin:
image: phpmyadmin:latest
env_file: settings.env
environment:
- APACHE_PORT=8082
- PMA_ABSOLUTE_URI=/phpmyadmin/
- PMA_HOST=${DATABASE_HOST}
- PMA_PORT=${DATABASE_PORT}
- PMA_USER=${DATABASE_USER}
- PMA_PASSWORD=${DATABASE_PASS}
deploy:
replicas: 1
secrets:
cssnr_basic_http_auth:
file: ~/basic_http_auth
volumes:
data_dir:
flower_data:
redis_data: