-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
84 lines (77 loc) · 2.13 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
x-server: &base_server_setup
restart: unless-stopped
image: etl-montandon/server
build:
context: ./
# Used for python debugging.
stdin_open: true
tty: true
env_file:
- .env
environment: &base_server_environments
DJANGO_DEBUG: ${DJANGO_DEBUG:-true}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:?err}
DB_NAME: ${DB_NAME:-postgres}
DB_USER: ${DB_USER:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-postgres}
DB_HOST: ${DB_HOST:-db}
DB_PORT: ${DB_PORT:-5432}
CELERY_REDIS_URL: ${CELERY_REDIS_URL:-redis://redis:6379/0}
# ETL Sources
EMDAT_AUTHORIZATION_KEY: ${EMDAT_AUTHORIZATION_KEY?error}
IDMC_CLIENT_ID: ${IDMC_CLIENT_ID?error}
GFD_CREDENTIAL: ${GFD_CREDENTIAL?error}
GFD_SERVICE_ACCOUNT: ${GFD_SERVICE_ACCOUNT?error}
IFRC_DATA_URL: ${IFRC_DATA_URL?error}
# ETL Load
EOAPI_DOMAIN: ${EOAPI_DOMAIN?error}
volumes:
- .:/code
- ipython_data_local:/root/.ipython/profile_default # persist ipython data, including ipython history
- local_cache_pull:/local-cache-data
depends_on:
- db
- redis
services:
db:
image: postgis/postgis:15-3.5-alpine
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_PORT=5432
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:6-alpine
volumes:
- redis-data:/data
web:
<<: *base_server_setup
command: bash -c "/code/scripts/run_develop.sh"
environment:
<<: *base_server_environments
DJANGO_APP_TYPE: "web"
ports:
- 8000:8000
depends_on:
- db
- redis
celery-beat:
<<: *base_server_setup
environment:
<<: *base_server_environments
DJANGO_APP_TYPE: "worker"
command: bash -c "/code/scripts/run_worker_beat.sh"
worker:
<<: *base_server_setup
environment:
<<: *base_server_environments
DJANGO_APP_TYPE: "worker"
# command: celery -A main worker --loglevel=info
command: bash -c "/code/scripts/run_worker.sh"
volumes:
postgres-data:
redis-data:
ipython_data_local:
local_cache_pull: