-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.test.yaml
75 lines (72 loc) · 1.73 KB
/
docker-compose.test.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
x-shared: &shared
env_file: .env
restart: unless-stopped
x-django: &django
<<: *shared
image: app
build:
context: .
dockerfile: Dockerfile_django
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- temporary-data:/data/media
depends_on:
- postgres
- redis
services:
traefik:
image: traefik:v2.4
ports:
- 80:80
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- 'traefik.enable=true'
command:
- '--api'
- '--api.insecure=true'
- '--providers.docker=true'
- '--providers.docker.exposedByDefault=false'
- '--entrypoints.http=true'
- '--entrypoints.http.address=:80'
postgres:
image: postgres:16
volumes:
- postgresql-data:/var/lib/postgresql/data
redis:
image: bitnami/redis:6.2
restart: always
environment:
ALLOW_EMPTY_PASSWORD: "yes"
healthcheck:
test: redis-cli -h 127.0.0.1 ping | grep -q PONG
interval: 10s
timeout: 5s
retries: 5
app:
<<: *django
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.app.entrypoints=http'
- 'traefik.http.routers.app.rule=PathPrefix(`/api/`)'
celery_worker:
<<: *django
command: celery -A core worker -l INFO --concurrency=4
celery_beat:
<<: *django
command: celery -A core beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
static:
image: static
build:
context: .
dockerfile: Dockerfile_static
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.site.entrypoints=http'
- 'traefik.http.routers.site.rule=PathPrefix(`/`)'
volumes:
- temporary-data:/data/media
volumes:
postgresql-data:
temporary-data: