-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
181 lines (171 loc) · 4.36 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
171
172
173
174
175
176
177
178
179
180
181
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}
ELASTICSEARCH_URL: elastic:9200
CELERY_TASK_ALWAYS_EAGER: 'False'
REDIS_URL: redis://redis:6379/4
DOCKER_HOST: ${DOCKER_HOST:-missing}
x-extra-hosts:
&default-extra-hosts # pragma: allowlist secret
- "edx.odl.local:${OPENEDX_IP:-172.22.0.1}"
- "host.docker.internal:host-gateway"
- "local.edly.io:host-gateway"
services:
db:
image: postgres:15.10
ports:
- "5432"
environment:
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
volumes:
- db-data:/var/lib/postgresql/data
redis:
image: redis:6.2.16
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: ./scripts/run-django-dev.sh
stdin_open: true
tty: true
ports:
- "8011:8011"
environment:
<< : *py-environment
PORT: 8011
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:
- .:/app
- django_media:/var/media
extra_hosts: *default-extra-hosts
watch:
image: node:17.9
working_dir: /app
command: ./scripts/run-watch-dev.sh
ports:
- "8012:8012"
environment:
PUBLIC_PATH: http://${MITX_ONLINE_HOSTNAME:-mitxonline.odl.local}:8012/
NODE_ENV: ${NODE_ENV:-development}
DOCKER_HOST: ${DOCKER_HOST:-missing}
CONTAINER_NAME: 'watch'
PORT: 8012
env_file: .env
volumes:
- .:/app
- 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
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:
- .:/app
- django_media:/var/media
extra_hosts: *default-extra-hosts
refine:
image: node:17.9
working_dir: /app
command: ./scripts/run-refine-dev.sh
ports:
- "8016:8016"
environment:
PUBLIC_PATH: http://${MITX_ONLINE_HOSTNAME:-mitxonline.odl.local}:8016/
PORT: 8016
NODE_ENV: ${NODE_ENV:-development}
volumes:
- .:/app
- 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:
- .:/app
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
volumes:
npm-cache: {}
django_media: {}
yarn-cache: {}
db-data: {}