-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
255 lines (240 loc) · 7.73 KB
/
docker-compose.yml
File metadata and controls
255 lines (240 loc) · 7.73 KB
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
x-environment:
&py-environment
DEBUG: '${DEBUG:-True}'
NODE_ENV: 'development'
DEV_ENV: 'True' # necessary to have nginx connect to web container
SECRET_KEY: local_unsafe_key
DATABASE_URL: postgres://postgres:postgres@db:5432/postgres # pragma: allowlist secret
MITX_ONLINE_BASE_URL: ${MITX_ONLINE_BASE_URL:-http://mitxonline.odl.local:8013}
MITX_ONLINE_SECURE_SSL_REDIRECT: 'False'
MITX_ONLINE_DB_DISABLE_SSL: 'True'
MITX_ONLINE_ADMIN_EMAIL: admin@localhost
MITX_ONLINE_REFINE_OIDC_CONFIG_CLIENT_ID: ${MITX_ONLINE_ADMIN_CLIENT_ID:-refine-local-client-id}
CELERY_TASK_ALWAYS_EAGER: 'False'
REDIS_URL: redis://redis:6379/4
DOCKER_HOST: ${DOCKER_HOST:-missing}
APISIX_PORT: ${APISIX_PORT:-9080}
KEYCLOAK_PORT: ${KEYCLOAK_PORT:-7080}
KEYCLOAK_SSL_PORT: ${KEYCLOAK_SSL_PORT:-7443}
UNIFIED_ECOMMERCE_URL: ${UNIFIED_ECOMMERCE_URL:-http://ue.odl.local:9080}
x-extra-hosts:
&default-extra-hosts # pragma: allowlist secret
- "edx.odl.local:${OPENEDX_IP:-172.22.0.1}"
- "host.docker.internal:host-gateway"
- "openedx.odl.local:host-gateway"
- "studio.openedx.odl.local:host-gateway"
- "apps.openedx.odl.local:host-gateway"
- "mitxonline.odl.local:host-gateway"
- "local.openedx.io:host-gateway"
- "studio.local.openedx.io:host-gateway"
- "dcc.odl.local:host-gateway"
services:
db:
image: postgres:15.16
ports:
- "5432"
environment:
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
volumes:
- db-data:/var/lib/postgresql/data
- ./config/db:/docker-entrypoint-initdb.d
redis:
image: redis:8.6.0
ports:
- "6379"
nginx:
build:
context: ./nginx
links:
- web
volumes:
- ./config/nginx.conf.erb:/etc/nginx/templates/nginx.conf.erb
- ./:/app
environment:
NGINX_WORKERS: 1
PORT: 8013
NGINX_UWSGI_PASS: "web:8011"
networks:
default:
aliases:
# this ensures that containers route this hostname back to the web app
- "mitxonline.odl.local"
web:
build:
context: .
dockerfile: Dockerfile
target: django-server
command: ["/bin/bash", "./scripts/run-django-dev.sh"]
stdin_open: true
tty: true
ports:
- "8011:8011"
environment:
<< : *py-environment
PORT: 8011
# these are necessary to get the hostname from the varnish proxy
USE_X_FORWARDED_HOST: true
USE_X_FORWARDED_PORT: true
env_file: .env
links:
- db
- redis
# these are links instead of `depends_on`
# because if we just want a shell for `web` we don't want to run these
- watch
- refine
volumes:
- .:/src
- django_media:/var/media
extra_hosts: *default-extra-hosts
watch:
image: node:17.9
working_dir: /src
command: ["/bin/bash", "./scripts/run-watch-dev.sh"]
ports:
- "8012:8012"
environment:
PUBLIC_PATH: ${MITX_ONLINE_WATCH_BASE_URL:-http://mitxonline.odl.local:8012/}
NODE_ENV: ${NODE_ENV:-development}
DOCKER_HOST: ${DOCKER_HOST:-missing}
CONTAINER_NAME: 'watch'
PORT: 8012
env_file: .env
volumes:
- .:/src
- yarn-cache:/home/mitodl/.cache/yarn
healthcheck:
test: curl -f http://watch:8012/health || exit 1
interval: 30s
timeout: 1s
retries: 4
start_period: 180s
celery:
build:
context: .
dockerfile: Dockerfile
target: django-server
environment: *py-environment
env_file: .env
command: >
/bin/bash -c '
sleep 3;
celery -A main.celery:app worker -Q hubspot_sync,celery -B -l ${MITX_ONLINE_LOG_LEVEL:-INFO}'
links:
- db
- redis
volumes:
- .:/src
- django_media:/var/media
extra_hosts: *default-extra-hosts
refine:
image: node:17.9
working_dir: /src
command: ["/bin/bash", "./scripts/run-refine-dev.sh"]
ports:
- "8016:8016"
environment:
PUBLIC_PATH: ${MITX_ONLINE_REFINE_BASE_URL:-http://mitxonline.odl.local:8016/}
PORT: 8016
NODE_ENV: ${NODE_ENV:-development}
volumes:
- .:/src
- npm-cache:/root/.npm
depends_on:
# this doesn't really depend on watch but they step on each other if they start at the same time
watch:
condition: service_healthy
healthcheck:
test: curl -f http://refine:8016/health || exit 1
interval: 30s
timeout: 1s
retries: 4
start_period: 180s
notebook:
build:
context: .
dockerfile: Dockerfile
target: jupyter-notebook
profiles: ["notebook"]
volumes:
- .:/src
environment:
<< : *py-environment
env_file: .env
command: >
/bin/bash -c '
sleep 3 &&
jupyter notebook --no-browser --ip=0.0.0.0 --port=8080'
ports:
- "8080:8080"
varnish:
image: varnish:fresh
links:
- nginx
ports:
- "8013:80"
volumes:
- ./config/default.vcl:/etc/varnish/default.vcl:ro
depends_on:
- nginx
keycloak:
image: quay.io/keycloak/keycloak:latest
profiles:
- keycloak
depends_on:
- db
environment:
- KEYCLOAK_SVC_KEYSTORE_PASSWORD=${KEYCLOAK_SVC_KEYSTORE_PASSWORD:-supersecret123456}
- KEYCLOAK_SVC_HOSTNAME=${KEYCLOAK_SVC_HOSTNAME:-kc.odl.local}
- KEYCLOAK_ADMIN=${KEYCLOAK_SVC_ADMIN:-admin}
- KEYCLOAK_ADMIN_PASSWORD=${KEYCLOAK_SVC_ADMIN_PASSWORD:-admin}
- KEYCLOAK_PORT=${KEYCLOAK_PORT:-7080}
- KEYCLOAK_SSL_PORT=${KEYCLOAK_SSL_PORT:-7443}
- _JAVA_OPTIONS=${JAVA_OPTIONS:-} # Load _JAVA_OPTIONS from env, fallback to empty string
ports:
- ${KEYCLOAK_PORT}:${KEYCLOAK_PORT:-7080}
- ${KEYCLOAK_SSL_PORT}:${KEYCLOAK_SSL_PORT:-7443}
networks:
default:
aliases:
- ${KEYCLOAK_SVC_HOSTNAME:-kc.odl.local}
command: start --verbose --features scripts --import-realm --hostname=${KEYCLOAK_SVC_HOSTNAME:-kc.odl.local} --hostname-strict=false --hostname-debug=true --https-port=${KEYCLOAK_SSL_PORT} --https-certificate-file=/etc/x509/https/tls.crt --https-certificate-key-file=/etc/x509/https/tls.key --http-enabled=true --http-port=${KEYCLOAK_PORT} --config-keystore=/etc/keycloak-store --config-keystore-password=${KEYCLOAK_SVC_KEYSTORE_PASSWORD} --db=postgres --db-url-database=keycloak --db-url-host=db --db-schema=public --db-password=${POSTGRES_PASSWORD:-postgres} --db-username=postgres
volumes:
- keycloak-store:/etc/keycloak-store
- ./config/keycloak/tls:/etc/x509/https
- ./config/keycloak/realms:/opt/keycloak/data/import
api:
image: apache/apisix:latest
profiles:
- apisix
environment:
- OPENEDX_API_BASE_URL={OPENEDX_API_BASE_URL:-http://openedx.odl.local:8000}
- KEYCLOAK_REALM=${KEYCLOAK_REALM:-ol-local}
- KEYCLOAK_CLIENT_ID=${KEYCLOAK_CLIENT_ID:-apisix}
- KEYCLOAK_CLIENT_SECRET=${KEYCLOAK_CLIENT_SECRET}
- KEYCLOAK_DISCOVERY_URL=${KEYCLOAK_DISCOVERY_URL:-https://kc.odl.local:7443/realms/ol-local/.well-known/openid-configuration}
- APISIX_PORT=${APISIX_PORT:-9080}
- APISIX_SESSION_SECRET_KEY=${APISIX_SESSION_SECRET_KEY:-something_at_least_16_characters}
- APP_LOGOUT_URL=${APP_LOGOUT_URL:-http://ue.odl.local:9080/auth/logout/}
ports:
- ${APISIX_PORT}:${APISIX_PORT}
volumes:
- ./config/apisix/config.yaml:/usr/local/apisix/conf/config.yaml
- ./config/apisix/apisix.yaml:/usr/local/apisix/conf/apisix.yaml
- ./config/apisix/debug.yaml:/usr/local/apisix/conf/debug.yaml
coordinator:
profiles:
- verifiable-creds
image: digitalcredentials/issuer-coordinator:1.0.0
ports:
- "4005:4005"
signer:
profiles:
- verifiable-creds
image: digitalcredentials/signing-service:1.2.0
volumes:
npm-cache: {}
django_media: {}
yarn-cache: {}
db-data: {}
keycloak-store: {}