-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
99 lines (93 loc) · 2.14 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
services:
toptokens-api:
build:
context: ./app
dockerfile: Dockerfile
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000
volumes:
- ./app/:/usr/src/app/
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
ports:
- 8000:8000
env_file:
- ./.env.dev
depends_on:
- toptokens-db
- redis
nginx:
build: ./nginx_dev
restart: always
volumes:
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
ports:
- 1337:80
depends_on:
- toptokens-api
links:
- redis
toptokens-db:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
restart: always
env_file:
- ./.env.dev
ports:
- "5432:5432"
links:
- redis
redis:
image: redis:7.2.5-alpine
hostname: redis
command: redis-server --save "" --appendonly no --maxmemory 1gb # Disable RDB snapshots and set max memory
volumes:
- redis_data:/data
environment:
- REDIS_MAXMEMORY=1gb
worker:
build:
context: ./app
dockerfile: Dockerfile
hostname: worker
entrypoint: celery
command: -A celery_app.app worker --loglevel=info
volumes:
- ./app/:/usr/src/app/
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
links:
- redis
depends_on:
- redis
- toptokens-db
- toptokens-api
env_file:
- ./.env.dev
environment:
- CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP=True
celery-beat:
build:
context: ./app
dockerfile: Dockerfile
hostname: celery-beat
entrypoint: celery
command: -A celery_app.app beat --loglevel=info
volumes:
- ./app/:/usr/src/app/
- static_volume:/usr/src/app/staticfiles
- media_volume:/usr/src/app/mediafiles
depends_on:
- redis
- toptokens-db
- toptokens-api
env_file:
- ./.env.dev
environment:
- CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP=True
volumes:
postgres_data:
static_volume:
media_volume:
redis_data: