-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
165 lines (155 loc) · 3.25 KB
/
docker-compose.yml
File metadata and controls
165 lines (155 loc) · 3.25 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
services:
postgres:
image: postgres:16
container_name: postgres
tty: true
stdin_open: true
restart: unless-stopped
env_file:
- ./.env
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_NAME}
PGDATA: "/var/lib/postgresql/data/pgdata"
TZ: ${TIMEZONE}
volumes:
- postgresdata:/var/lib/postgresql/data
expose:
- "5432"
ports:
- "127.0.0.1:5432:5432"
networks:
- main
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_NAME}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis/redis-stack:6.2.6-v17
container_name: redis
restart: unless-stopped
tty: true
stdin_open: true
env_file:
- ./.env
environment:
REDIS_ARGS: "--requirepass ${REDIS_PASSWORD}"
TZ: ${TIMEZONE}
networks:
- main
expose:
- "6379"
ports:
- "127.0.0.1:6379:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "$REDIS_PASSWORD", "ping"]
interval: 30s
timeout: 10s
retries: 5
nginx:
build: ./images/nginx/
container_name: nginx
tty: true
stdin_open: true
ports:
- "80:80"
- "443:443"
networks:
- main
environment:
- TZ=${TIMEZONE}
depends_on:
- app
restart: unless-stopped
healthcheck:
test: ["CMD", "service", "nginx", "status"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
worker-collector:
build: ../Collector
container_name: worker-collector
command: python -m celery -A src worker --loglevel=info
networks:
- main
environment:
- TZ=${TIMEZONE}
depends_on:
- postgres
- redis
beat-collector:
build: ../Collector
container_name: beat-collector
command: python -m celery -A src beat --loglevel=info
networks:
- main
environment:
- TZ=${TIMEZONE}
depends_on:
- postgres
- redis
flower:
build: ../Collector
container_name: flower
command: python -m celery flower --port=5555 --persistent=True --max_tasks=200 --db=/app/celery/flower
networks:
- main
environment:
- TZ=${TIMEZONE}
ports:
- "127.0.0.1:5555:5555"
expose:
- "5555"
volumes:
- flower:/app/celery
depends_on:
- beat-collector
- worker-collector
worker-main:
build: .
container_name: worker-main
command: python -m celery -A main.celery worker --loglevel=info
networks:
- main
environment:
- TZ=${TIMEZONE}
depends_on:
- postgres
- redis
- app
beat-main:
build: .
container_name: beat-main
command: python -m celery -A main.celery beat --loglevel=info
networks:
- main
environment:
- TZ=${TIMEZONE}
depends_on:
- postgres
- redis
- app
app:
build: .
container_name: app
command: gunicorn
environment:
- TZ=${TIMEZONE}
depends_on:
- postgres
- redis
networks:
- main
networks:
main:
driver: bridge
volumes:
postgresdata:
redisdata:
flower: