-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
164 lines (155 loc) · 3.66 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
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
version: "3.8"
x-env-app:
&env-app
environment:
- DEBUG
- LOG_LEVEL
- DATABASE_DSN
- CELERY_BROKER
- CELERY_HOUR_BEAT_INTERVAL
- CELERY_MINUTE_BEAT_INTERVAL
- TELEGRAM_TOKEN
- EASY_NOTIFYER_TOKEN
- EASY_NOTIFYER_CHAT_ID
- EASY_NOTIFYER_SERVICE_NAME
- POCKET_CONSUMER_KEY
- POCKET_REDIRECT_URL
- LIMIT_LOAD_FEED
- LIMIT_TITLE_MESSAGE
- LIMIT_TEXT_MESSAGE
- LIMIT_COUNT_FEED_USER
services:
backend:
image: ${PRIVATE_REGISTRY:-}rss_bot_backend:${VERSION:-latest}
build:
context: ./backend
dockerfile: ./docker/backend.dockerfile
hostname: backend
restart: unless-stopped
healthcheck:
test:
- "CMD"
- "sh"
- "-c"
- "curl --fail http://localhost:${RSS_BOT_PORT:-8000}/rss_bot/backend/healthcheck/ || exit 1"
interval: 60s
timeout: 30s
retries: 10
depends_on:
- nginx
<<: *env-app
volumes:
- ./db/:/app/app/db/
- ./logs/:/app/docker/logs/
admin:
image: ${PRIVATE_REGISTRY:-}rss_bot_admin:${VERSION:-latest}
build:
context: ./admin
dockerfile: ./docker/Dockerfile
hostname: admin
restart: unless-stopped
healthcheck:
test:
- "CMD"
- "sh"
- "-c"
- "curl --fail http://localhost:${RSS_BOT_PORT:-8001}/rss_bot/admin/healthcheck/ || exit 1"
interval: 60s
timeout: 30s
retries: 10
depends_on:
- nginx
environment:
- DEBUG={DEBUG:-False}
- ALLOWED_HOSTS=admin
- SECRET_KEY=${SECRET_KEY}
- DATABASE_DSN=${DATABASE_DSN}
volumes:
- ./db:/app/app/db
- ./logs/:/app/docker/logs/
- static_volume:/app/app/static/
nginx:
image: nginx:1.21.0
restart: unless-stopped
healthcheck:
test:
- "CMD"
- "sh"
- "-c"
- "service nginx status || exit 1"
interval: 120s
timeout: 30s
retries: 10
ports:
- ${NGINX_PORT:-8000}:80
volumes:
# - static_volume # todo: добавить ассесс лог
- ./nginx:/etc/nginx/conf.d
- static_volume:/app/app/static/
worker:
image: ${PRIVATE_REGISTRY:-}rss_bot_worker:${VERSION:-latest}
build:
context: ./backend
dockerfile: ./docker/worker.dockerfile
hostname: worker
restart: unless-stopped
healthcheck:
test:
- "CMD"
- "sh"
- "-c"
- "celery --broker=${CELERY_BROKER} inspect ping | grep OK || exit 1"
interval: 120s
timeout: 30s
retries: 10
depends_on:
- rabbitmq
<<: *env-app
volumes:
- ./db:/app/app/db
- ./logs/:/app/docker/logs/
command: [ "worker" ]
beat:
image: ${PRIVATE_REGISTRY:-}rss_bot_worker:${VERSION:-latest}
build:
context: ./backend
dockerfile: ./docker/worker.dockerfile
hostname: beat
restart: unless-stopped
healthcheck:
test:
- "CMD"
- "sh"
- "-c"
- "celery --broker=${CELERY_BROKER} inspect ping | grep OK || exit 1"
interval: 120s
timeout: 30s
retries: 10
depends_on:
- rabbitmq
<<: *env-app
volumes:
- ./db:/app/app/db
- ./logs/:/app/docker/logs/
command: [ "beat" ]
rabbitmq:
image: rabbitmq:3.8.16
restart: unless-stopped
hostname: rabbitmq
healthcheck:
test:
- "CMD"
- "rabbitmq-diagnostics"
- "-q"
- "ping"
interval: 120s
timeout: 30s
retries: 10
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER:-user}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD:-hackme}
volumes:
static_volume:
networks:
default:
name: rss_bot