-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
137 lines (126 loc) · 3.78 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
x-server: &base_server_setup
image: ghcr.io/the-deep/qber-backend:${DOCKER_BACKEND_TAG:-latest}
build:
context: ./backend/
tty: true
environment: &base_server_environment
APP_ENVIRONMENT: development
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY?err}
# To overwrite this values. set the values in .env
DJANGO_DEBUG: ${DJANGO_DEBUG:-True}
APP_DOMAIN: localhost:8311
APP_HTTP_PROTOCOL: http
APP_FRONTEND_HOST: localhost:3000
SESSION_COOKIE_DOMAIN: ${SESSION_COOKIE_DOMAIN:-localhost}
CSRF_COOKIE_DOMAIN: ${CSRF_COOKIE_DOMAIN:-localhost}
DJANGO_ALLOWED_HOST: ${DJANGO_ALLOWED_HOST:-*}
DJANGO_DB_NAME: ${DJANGO_DB_NAME:-qber}
DJANGO_DB_USER: ${DJANGO_DB_USER:-postgres}
DJANGO_DB_PASSWORD: ${DJANGO_DB_PASSWORD:-postgres}
DJANGO_DB_PORT: ${DJANGO_DB_PORT:-5432}
DJANGO_DB_HOST: ${DJANGO_DB_HOST:-db}
# EMAIL
EMAIL_FROM: ${EMAIL_FROM:[email protected]}
# Enketo
ENKETO_DOMAIN: ${ENKETO_DOMAIN:-http://localhost:8005}
# Redis
CELERY_REDIS_URL: ${CELERY_REDIS_URL:-redis://redis:6379/1}
DJANGO_CACHE_REDIS_URL: ${DJANGO_CACHE_REDIS_URL:-redis://redis:6379/2}
TEST_DJANGO_CACHE_REDIS_URL: ${TEST_DJANGO_CACHE_REDIS_URL:-redis://redis:6379/12}
# FS Config
DJANGO_STATIC_ROOT: '/app-assets/static'
DJANGO_MEDIA_ROOT: '/app-assets/media'
env_file:
# Provide additional environment variables using .env file
- .env
volumes:
- ./backend/:/code
- server-media:/app-assets/media
- server-static:/app-assets/static
- ipython_data_local:/root/.ipython/profile_default # persist ipython data, including ipython history
depends_on:
- db
- redis
services:
react:
tty: true
build:
context: .
target: dev
environment:
APP_TITLE: ${APP_TITLE:-Questionnaire Builder}
APP_STATIC_ENDPOINT: ${APP_STATIC_ENDPOINT:-http://localhost:8311}
APP_GRAPHQL_ENDPOINT: ${APP_GRAPHQL_ENDPOINT:-http://localhost:8311/graphql/}
env_file:
- .env
command: sh -c 'yarn install && yarn start --host'
ports:
- '3000:3000'
volumes:
- .:/code
db:
image: postgis/postgis:15-master
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: qber
volumes:
- postgres-data15:/var/lib/postgresql/data
redis:
image: redis:latest
volumes:
- redis-data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 10s
timeout: 5s
retries: 5
api:
<<: *base_server_setup
environment:
<<: *base_server_environment
APP_TYPE: web
command: ./scripts/run_develop.sh
ports:
- 8311:8000
worker:
<<: *base_server_setup
environment:
<<: *base_server_environment
APP_TYPE: worker
command: ./manage.py run_celery_dev
enketo_redis_main:
image: redis:7.0
volumes:
- enketo_redis_main-data:/data
restart: unless-stopped
enketo_redis_cache:
image: redis:7.0
volumes:
- enketo_redis_cache-data:/data
restart: unless-stopped
# TODO: Basic
enketo:
image: ghcr.io/enketo/enketo-express:6.2.2
depends_on:
- enketo_redis_main
- enketo_redis_cache
environment:
ENKETO_PORT: 8005
SUPPORT_EMAIL: ${SUPPORT_EMAIL:[email protected]}
ENKETO_REDIS_MAIN_URL: redis://redis:redis@enketo_redis_main:6379
ENKETO_REDIS_CACHE_URL: redis://redis:redis@enketo_redis_cache:6379
ENKETO_API_KEY: ${ENKETO_API_KEY?err}
ENKETO_ENCRYPTION_KEY: ${ENKETO_API_KEY?err}
command: bash -c "cd $${ENKETO_SRC_DIR}/ && pm2-runtime app.js -n enketo"
restart: unless-stopped
ports:
- '8005:8005'
volumes:
server-media:
server-static:
postgres-data15:
redis-data:
ipython_data_local:
enketo_redis_main-data:
enketo_redis_cache-data: