-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
102 lines (82 loc) · 1.83 KB
/
docker-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
version: "3.8"
x-django-app-env: &django-app-env
env_file:
- .env.docker
environment:
DEBUG: True
DB_ENGINE: "django.db.backends.postgresql_psycopg2"
DB_HOST: "postgres"
DB_USER: "postgres"
DB_NAME: "postgres"
DB_PASSWORD: "postgres"
CELERY_BROKER_URL: "redis://redis:6379/0"
CELERY_RESULT_BACKEND: "redis://redis:6379/0"
restart: always
services:
web:
depends_on:
- postgres
- redis
build: .
<<: *django-app-env
command: /bin/sh -c "python manage.py migrate; python manage.py creategroups; python manage.py runserver --noreload 0.0.0.0:80"
ports:
- "8080:80"
networks:
- net_lan
celery:
depends_on:
- postgres
- redis
- web
build: .
networks:
- net_lan
<<: *django-app-env
command: celery -A config worker -l INFO
celery-beat:
depends_on:
- postgres
- redis
- web
build: .
networks:
- net_lan
<<: *django-app-env
command: celery -A config beat -l INFO -S django
postgres:
image: postgres:alpine3.19
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "postgres"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: always
volumes:
- postgres_hw7_data:/var/lib/postgresql/data
networks:
- net_lan
redis:
image: redis:alpine3.19
restart: always
healthcheck:
test: [ "CMD-SHELL", "redis-cli --raw incr ping" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
volumes:
- redis_hw7_data:/data
networks:
- net_lan
volumes:
postgres_hw7_data:
redis_hw7_data:
networks:
net_lan:
driver: bridge