-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
169 lines (159 loc) · 3.86 KB
/
docker-compose.yaml
File metadata and controls
169 lines (159 loc) · 3.86 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
version: "3.8"
services:
nginx:
build:
context: nginx
image: django5-boiler-nginx:latest
env_file: settings.env
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
secrets:
- source: cssnr_basic_http_auth
target: /etc/nginx/auth.users
depends_on:
- app
- flower
- redis-commander
- phpmyadmin
ports:
- "80:80"
develop:
watch:
- action: rebuild
path: nginx
app:
build:
context: .
dockerfile: ./app/Dockerfile
image: django5-boiler-app:latest
env_file: settings.env
#command: "watchmedo auto-restart -d /app -p '*.py;*.html' -R -- gunicorn project.asgi:application -b 0.0.0.0:9000 -w 1 -k uvicorn.workers.UvicornWorker"
#command: "gunicorn project.asgi:application -b 0.0.0.0:9000 -w 1 -k uvicorn.workers.UvicornWorker --reload"
command: "uvicorn project.asgi:application --host 0.0.0.0 --port 9000 --reload --reload-include *.html"
#command: "sh -c 'python manage.py runserver 0.0.0.0:9000'"
#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
depends_on:
- redis
develop:
watch:
- action: sync
path: app
target: app
#- action: sync+exec
# path: app/templates
# target: app/templates
# exec:
# command: "pkill -HUP gunicorn"
- action: sync+exec
path: app/static
target: app/static
exec:
command: "python manage.py collectstatic --noinput -v 0"
- action: rebuild
path: pyproject.toml
- action: rebuild
path: uv.lock
worker:
image: django5-boiler-app:latest
env_file: settings.env
command: "celery -A project worker -l INFO -c 2"
deploy:
replicas: 1
resources:
limits:
cpus: "2.0"
memory: 256M
#volumes:
# - data_dir:/data
depends_on:
- redis
develop:
watch:
- action: restart
path: app/**/*.py
beat:
image: django5-boiler-app: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:1.2
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: