-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·111 lines (96 loc) · 2.13 KB
/
docker-compose.yml
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
services:
app:
container_name: app
build: .
command: sh -c "python manage.py makemigrations && python manage.py migrate && gunicorn core.wsgi:application -c gunicorn_config.conf --reload"
volumes:
- static_volume:/code/back/statics/
- .:/code/back/
ports:
- "8002:8002"
networks:
- main
env_file:
- ./.env
environment:
- TZ=Asia/Tehran
restart: on-failure
redis:
container_name: redis
image: docker.arvancloud.ir/redis:7.2
ports:
- "6379:3679"
restart: on-failure
environment:
- TZ=Asia/Tehran
networks:
- main
postgres:
container_name: postgres
image: docker.arvancloud.ir/postgres:16.1
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- TZ=Asia/Tehran
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
networks:
- main
ports:
- "5433:5432"
mem_limit: 1gb
celery_worker:
container_name: celery_worker
build: .
command: sh -c "celery -A core worker -l INFO"
depends_on:
- app
environment:
- TZ=Asia/Tehran
- C_FORCE_ROOT=true
- CELERY_BROKER_URL=redis://redis:6379/0
networks:
- main
restart: on-failure
volumes:
- .:/code/back/
celery_beat:
container_name: celery_beat
build: .
command: "celery -A core beat -l info"
networks:
- main
depends_on:
- app
environment:
- TZ=Asia/Tehran
- CELERY_BROKER_URL=redis://redis:6379/0
restart: on-failure
volumes:
- .:/code/back/
- static_volume:/code/back/statics/
nginx:
container_name: nginx
command: nginx -g 'daemon off;'
depends_on:
- app
image: docker.arvancloud.ir/nginx:1.25
networks:
- main
ports:
- "80:80"
- "443:443"
environment:
- TZ=Asia/Tehran
restart: always
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- /etc/letsencrypt/:/etc/letsencrypt/
- static_volume:/statics/
networks:
main:
volumes:
postgres_data:
driver: local
static_volume: