-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose-alpha.yml
182 lines (170 loc) · 5.63 KB
/
docker-compose-alpha.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
171
172
173
174
175
176
177
178
179
180
181
182
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}
# 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
restart: unless-stopped
volumes:
- ./server/:/code
- server-media:/media
- server-static:/static
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_END: ${REACT_APP_API_END:-localhost:8000}
REACT_APP_ADMIN_END: ${REACT_APP_ADMIN_END:-localhost:8000}
REACT_APP_DEEP_ENVIRONMENT: ${REACT_APP_DEEP_ENVIRONMENT:-development}
env_file:
- .env
command: bash -c 'yarn install && yarn build && cp -r ./build/* /build/'
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
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:6-alpine
volumes:
- redis-data:/data
restart: unless-stopped
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'
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
- client-static:/build/
ary-client:
<<: *base_client_setup
image: docker.pkg.github.com/the-deep/client:ary-only
build:
context: ./ary-only-client/
volumes:
- ./ary-only-client/:/code
- client-ary-static:/build/
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
nginx:
image: nginx:1.21
user: root
volumes:
# Nginx config
- ./nginx.alpha.conf.template:/etc/nginx/templates/default.conf.template:ro
# Static files
- client-static:/app-assests/client-static:ro
- client-ary-static:/app-assests/client-ary-static:ro
- server-static:/app-assests/server-static:ro
# Media files
- server-media:/app-assests/server-media:ro
# Cert
- ./nginx-certs:/nginx-certs
restart: unless-stopped
environment:
- NGINX_SERVER_HOST=${DEEP_BACKEND_HOST}
- NGINX_CLIENT_HOST=${DEEP_FRONTEND_HOST}
- NGINX_CLIENT_ARY_HOST=${DEEP_FRONTEND_ARY_HOST}
ports:
- '8001:443'
# depends_on:
# - web
volumes:
postgres-data:
postgres-data13:
redis-data:
client-static:
client-ary-static:
server-static:
server-media: