-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
170 lines (159 loc) · 5.48 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
version: '3.2'
x-server: &base_server_setup
build:
context: ./server/
# To attach to container with stdin `docker attach <container_name>`
# Used for python debugging.
stdin_open: true
tty: true
environment: &base_server_environment
# To overwrite this values. set the values in .env
DJANGO_DEBUG: ${DJANGO_DEBUG:-True}
DEEP_ENVIRONMENT: ${DEEP_ENVIRONMENT:-development}
DEEP_FRONTEND_HOST: ${DEEP_FRONTEND_HOST:-localhost:3000}
DEEP_FRONTEND_ARY_HOST: ${DEEP_FRONTEND_ARY_HOST:-localhost:3001}
DEEP_BACKEND_HOST: ${DEEP_BACKEND_HOST:-localhost:8000}
DJANGO_ALLOWED_HOST: ${DJANGO_ALLOWED_HOST:-localhost}
SESSION_COOKIE_DOMAIN: ${SESSION_COOKIE_DOMAIN:-localhost}
CSRF_COOKIE_DOMAIN: ${CSRF_COOKIE_DOMAIN:-localhost}
EMAIL_FROM: ${EMAIL_FROM:[email protected]}
# From db.environment
DATABASE_NAME: ${DATABASE_NAME:-deep}
DATABASE_USER: ${DATABASE_USER:-postgres}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-postgres}
DATABASE_PORT: ${DATABASE_PORT:-5432}
DATABASE_HOST: ${DATABASE_HOST:-db}
# From redis
CELERY_REDIS_URL: ${CELERY_REDIS_URL:-redis://redis:6379/0}
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}
# HID
HID_CLIENT_ID: ${HID_CLIENT_ID:-deep-local}
HID_CLIENT_REDIRECT_URL: ${HID_CLIENT_REDIRECT_URL:-http://localhost:3000/login/}
HID_AUTH_URI: ${HID_AUTH_URI:-https://api2.dev.humanitarian.id}
# DEEPL Service
DEEPL_SERVICE_DOMAIN: ${DEEPL_SERVICE_DOMAIN:-http://extractor:8001}
DEEPL_SERVICE_CALLBACK_DOMAIN: ${DEEPL_SERVICE_CALLBACK_DOMAIN:-http://web:8000}
# DEEPL Server -> https://github.com/the-deep-nlp
DEEPL_SERVER_TOKEN: ${DEEPL_SERVER_TOKEN?err}
DEEPL_SERVER_DOMAIN: ${DEEPL_SERVER_DOMAIN?err}
DEEPL_SERVER_CALLBACK_DOMAIN: ${DEEPL_SERVER_CALLBACK_DOMAIN?err}
env_file:
- .env
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./server/:/code
- media:/media
- ipython_data_local:/root/.ipython/profile_default # persist ipython data, including ipython history
depends_on:
- db
- redis
- extractor
x-client: &base_client_setup
tty: true
environment:
# To overwrite this values. set the values in .env
GRAPHQL_CODEGEN_ENDPOINT: ${GRAPHQL_CODEGEN_ENDPOINT:-http://web:8000/graphql}
REACT_APP_GRAPHQL_ENDPOINT: ${REACT_APP_GRAPHQL_ENDPOINT:-http://localhost:8000/graphql}
REACT_APP_STATIC_ENDPOINT: ${REACT_APP_STATIC_ENDPOINT:-http://localhost:8000}
REACT_APP_API_HTTPS: ${REACT_APP_API_HTTPS:-http}
REACT_APP_API_END: ${REACT_APP_API_END:-localhost:8000}
REACT_APP_ADMIN_END: ${REACT_APP_ADMIN_END:-localhost:8000}
REACT_APP_PDF_CACHE_ENDPOINT: ${REACT_APP_PDF_CACHE_ENDPOINT:-https://snapshot-proxy.thedeep.io}
REACT_APP_DEEP_ENVIRONMENT: ${REACT_APP_DEEP_ENVIRONMENT:-development}
REACT_APP_ASSESSMENT_REGISTRY_END: ${REACT_APP_ASSESSMENT_REGISTRY_END:-http://localhost:3001}
REACT_APP_GA_MEASUREMENT_ID: ${REACT_APP_GA_MEASUREMENT_ID:-}
extra_hosts:
- "host.docker.internal:host-gateway"
env_file:
- .env
command: bash -c '/code/scripts/run_develop.sh'
services:
db:
image: postgis/postgis:13-3.1-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: deep
volumes:
- postgres-data13:/var/lib/postgresql/data
# command: postgres -c log_statement=all
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:6-alpine
volumes:
- redis-data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
interval: 10s
timeout: 5s
retries: 5
web:
<<: *base_server_setup
image: docker.pkg.github.com/the-deep/server/web:latest
build:
context: ./server/
target: web
environment:
<<: *base_server_environment
SERVICE_ENVIRONMENT_TYPE: web
command: bash -c 'wait-for-it $$DATABASE_HOST:$$DATABASE_PORT && /code/scripts/run_web.sh'
ports:
- '8000:8000'
worker:
<<: *base_server_setup
image: docker.pkg.github.com/the-deep/server/worker:latest
build:
context: ./server/
target: worker
environment:
<<: *base_server_environment
SERVICE_ENVIRONMENT_TYPE: worker
command: bash -c '/code/scripts/run_worker.sh'
healthcheck:
test: ["CMD-SHELL", "celery -A deep inspect ping -d celery@$$HOSTNAME || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
client:
<<: *base_client_setup
image: docker.pkg.github.com/the-deep/client:latest
build:
context: ./client/
volumes:
- ./client/:/code
ports:
- '3000:3000'
ary-client:
<<: *base_client_setup
image: docker.pkg.github.com/the-deep/ary-only-client:latest
build:
context: ./ary-only-client/
volumes:
- ./ary-only-client/:/code
ports:
- '3001:3000'
extractor:
image: docker.pkg.github.com/the-deep/deepl-service:latest
build:
context: ./deepl-service/
command: bash -c '/code/scripts/run_develop.sh'
tty: true
environment:
EXTRACTOR_DOMAIN_NAME: ${EXTRACTOR_DOMAIN_NAME:-http://extractor:8001}
EXTRACTOR_REDIS_URL: ${EXTRACTOR_REDIS_URL:-redis://redis:6379/3}
volumes:
- ./deepl-service/:/code
depends_on:
- redis
volumes:
media:
postgres-data13:
redis-data:
ipython_data_local: