-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
75 lines (69 loc) · 1.8 KB
/
docker-compose.yaml
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
version: "3"
services:
db:
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data:rw
environment:
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD}
ports:
- ${PG_DOCKER_MAPPING}
web:
image: nous_aggregator
build: &web_build
context: .
dockerfile: Dockerfile
restart: always
environment: &web_env
- DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE}
- SECRET_KEY=${SECRET_KEY}
# Network
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- CSRF_TRUSTED_ORIGINS=${CSRF_TRUSTED_ORIGINS}
- SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE}
- CSRF_COOKIE_SECURE=${CSRF_COOKIE_SECURE}
- SECURE_SSL_REDIRECT=${SECURE_SSL_REDIRECT}
# Database
- DATABASE_ENGINE=${DATABASE_ENGINE}
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_USER=${DATABASE_USER}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_HOST=${DATABASE_HOST}
- DATABASE_PORT=${DATABASE_PORT}
# Redis + Celery
- REDIS_PORT=${REDIS_PORT}
- CELERY_BROKER_URL=${CELERY_BROKER_URL_DOCKER}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND_DOCKER}
- CELERY_LOGLEVEL=${CELERY_LOGLEVEL}
volumes:
- .:/app
command: >
sh -c "python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
depends_on:
- db
- redis
redis:
image: redis
celery-worker:
build: *web_build
environment: *web_env
command: celery -A nous_aggregator worker
volumes:
- .:/app
depends_on:
- db
- redis
celery-beat:
build: *web_build
environment: *web_env
command: celery -A nous_aggregator beat
volumes:
- .:/app
depends_on:
- db
- redis
volumes:
postgres_data: