-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
74 lines (65 loc) · 1.88 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
version: "3.4"
x-django-tpl: &django-tpl
build: .
restart: unless-stopped
environment: &django-env-tpl
DATABASE_URL: "postgres://cwa_notifier:changeme@db/cwa_notifier"
CACHE_URL: "redis://redis/1"
CELERY_CACHE_URL: "redis://redis/2"
CELERY_RESULT_URL: "redis://redis/3"
BROKER_URL: "amqp://rabbitmq"
# TODO: customize the following ones
SECRET_KEY: "django-insecure-t*m4njw77bnd-uotk$hbjfy+#cyu#e90hl=$v9^ybtx-572(0a" # python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'
ALLOWED_HOSTS: "localhost"
TELEGRAM_TOKEN: ""
CSRF_TRUSTED_ORIGINS: "http://localhost"
depends_on:
- db
- rabbitmq
- redis
volumes:
- ./data/packages:/usr/src/app/data/packages:rw
- ./mediafiles:/usr/src/app/mediafiles:rw
- staticfiles:/usr/src/app/staticfiles:rw
services:
db:
image: postgres
restart: unless-stopped
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
POSTGRES_DB: "cwa_notifier"
POSTGRES_USER: "cwa_notifier"
POSTGRES_PASSWORD: "changeme"
rabbitmq:
image: rabbitmq:3-management-alpine
restart: unless-stopped
hostname: rabbitmq
volumes:
- ./data/rabbitmq:/var/lib/rabbitmq
redis:
image: redis:alpine
restart: unless-stopped
nginx:
build: .deployment/nginx
restart: unless-stopped
volumes:
- ./mediafiles:/var/www/html/media:ro
- staticfiles:/var/www/html/static:ro
ports:
- "8000:80"
depends_on:
- web
web:
<<: *django-tpl
environment:
<<: *django-env-tpl
DJANGO_MANAGEPY_MIGRATE: "on"
worker:
<<: *django-tpl
command: "celery -A cwa_venue_notifier worker -B -E -Q celery -l INFO -s /tmp/celerybeat-schedule" # "-B" enables beat
telegram:
<<: *django-tpl
command: "python manage.py start_polling"
volumes:
staticfiles: