-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
77 lines (73 loc) · 1.71 KB
/
docker-compose.yml
File metadata and controls
77 lines (73 loc) · 1.71 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
services:
mariadb:
image: mariadb:11.7.2
environment:
MARIADB_DATABASE: ${DB_NAME:-editgroups}
MARIADB_ROOT_PASSWORD: ${DB_PASSWORD:-editgroups}
volumes:
- mariadb:/var/lib/mysql
healthcheck:
test: healthcheck.sh --connect --innodb_initialized
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
expose:
- 3306
redis:
image: redis:7.4
expose:
- 6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
app:
ports:
- 8000:8000
healthcheck:
test: curl --fail http://localhost:8000/ || exit 1
start_period: 10s
interval: 10s
command: >
/bin/bash -c "
django-admin collectstatic --no-input &&
django-admin migrate &&
django-admin runserver 0.0.0.0:8000
"
<<: &app
build:
context: .
dockerfile: Dockerfile
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
environment:
- SECRET_KEY=${DJANGO_SECRET_KEY:-}
- DB_NAME=${DB_NAME:-editgroups}
- DB_PASSWORD=${DB_NAME:-editgroups}
celery:
<<: *app
command: >
/bin/bash -c "
source ../venv/bin/activate
C_FORCE_ROOT=1 python3 ../venv/bin/celery --app=editgroups.celery:app worker -l INFO -B --concurrency=3 --max-memory-per-child=50000
"
depends_on:
app:
condition: service_healthy
listener:
<<: *app
command: >
/bin/bash -c "
source ../venv/bin/activate
django-admin listener
"
depends_on:
app:
condition: service_healthy
volumes:
mariadb: