-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
102 lines (94 loc) · 2.98 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
version: '2'
x-datamart-defaults: &datamart_defaults
build:
context: .
dockerfile: ./Dockerfile
depends_on:
- db
- redis
volumes:
- "$PWD:/code"
environment:
DEBUG: 1
DATABASE_URL: postgis://postgres:@db:5432/etools_datamart
DATABASE_URL_ETOOLS: postgis://postgres:@db-etools:5432/etools
DATABASE_URL_PRP: postgis://postgres:@db-prp:5432/prp
AUTOCREATE_USERS: "admin,123"
CACHE_URL: "redis://redis:6379/1"
CACHE_URL_LOCK: "redis://redis:6379/1"
CACHE_URL_API: "redis://redis:6379/1"
CACHE_URL_TEMPLATE: "redis://redis:6379/1"
CELERY_BROKER_URL: "redis://redis:6379/0"
CELERY_RESULT_BACKEND: "redis://redis:6379/2"
CSRF_COOKIE_SECURE: 0
SECURE_BROWSER_XSS_FILTER: 0
SECURE_CONTENT_TYPE_NOSNIFF: 0
SECURE_FRAME_DENY: 0
SECURE_HSTS_PRELOAD: 0
SECURE_SSL_REDIRECT: 0
SESSION_COOKIE_HTTPONLY: 0
SESSION_COOKIE_SECURE: 0
STATIC_ROOT: /code/src/etools_datamart/apps/web/static/
GEOS_LIBRARY_PATH: "/usr/lib/libgeos_c.so.1"
GDAL_LIBRARY_PATH: "/usr/lib/libgdal.so"
EXPORT_FILE_STORAGE: "django.core.files.storage.FileSystemStorage"
services:
proxy:
image: traefik:v2.1
command: --api.insecure=True --providers.docker
ports:
- "8083:80"
- "8080:8080"
container_name: datamart_proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
datamart:
container_name: datamart
<< : *datamart_defaults
command: bash -c "python /code/manage.py init-setup --migrate && python /code/manage.py runserver 0.0.0.0:8080"
labels:
- "traefik.http.routers.datamart.rule=PathPrefix(`/`)"
- traefik.http.routers.datamart.service=datamart
- traefik.http.services.datamart.loadBalancer.server.port=8080
- traefik.enable=true
beat:
container_name: datamart_beat
<< : *datamart_defaults
command: celery -A etools_datamart beat --loglevel=info --workdir=/code/src
worker:
container_name: datamart_worker
<< : *datamart_defaults
command: celery -A etools_datamart worker --loglevel=info --workdir=/code/src
db:
image: postgis/postgis:12-3.2
container_name: datamart_db
environment:
POSTGRES_PASSWORD:
POSTGRES_USER: postgres
POSTGRES_DB: etools_datamart
volumes:
- "$PWD/build/db:/var/lib/postgresql/data"
# Rely on etools and prp database instances running locally
db-etools:
image: postgis/postgis:12-3.2
container_name: datamart_etools
shm_size: '1gb'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD:
POSTGRES_DB: etools
volumes:
- "$PWD/build/etools:/var/lib/postgresql/data"
db-prp:
image: postgis/postgis:12-3.2
shm_size: '1gb'
container_name: datamart_prp
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD:
POSTGRES_DB: prp
volumes:
- "$PWD/build/prp:/var/lib/postgresql/data"
redis:
image: redis:alpine
container_name: datamart_redis