-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
97 lines (90 loc) · 2.38 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
x-environment: &py-environment
NODE_ENV: "production"
DEV_ENV: "True" # necessary to have nginx connect to web container
SECRET_KEY: local_unsafe_key
DATABASE_URL: postgres://postgres:postgres@db:5432/postgres
MITOL_DIGITAL_CREDENTIALS_HMAC_SECRET: test-hmac-secret
MITXPRO_BASE_URL: ${MITXPRO_BASE_URL:-http://xpro.odl.local:8053}
MITXPRO_SECURE_SSL_REDIRECT: "False"
MITXPRO_DB_DISABLE_SSL: "True"
MITXPRO_ADMIN_EMAIL: admin@localhost
MITOL_DIGITAL_CREDENTIALS_AUTH_TYPE: xpro
ELASTICSEARCH_URL: elastic:9200
CELERY_TASK_ALWAYS_EAGER: "False"
REDIS_URL: redis://redis:6379/4
DOCKER_HOST: ${DOCKER_HOST:-missing}
WEBPACK_DEV_SERVER_HOST: ${WEBPACK_DEV_SERVER_HOST:-localhost}
x-extra-hosts: &default-extra-hosts
- "edx.odl.local:${OPENEDX_IP:-172.22.0.1}"
- "host.docker.internal:host-gateway"
services:
db:
image: postgres:16.4
environment:
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
ports:
- "5432"
redis:
image: redis:7.4.1
ports:
- "6379"
nginx:
image: nginx:1.27.2
ports:
- "8053:8053"
links:
- web
networks:
default:
aliases:
# this ensures that containers route this hostname back to the web app
- "xpro.odl.local"
web:
build:
context: .
dockerfile: Dockerfile
command: >
/bin/bash -c '
sleep 3 &&
python3 manage.py collectstatic --noinput &&
python3 manage.py migrate --noinput &&
uwsgi uwsgi.ini --honour-stdin'
stdin_open: true
tty: true
ports:
- "8051:8051"
environment:
<<: *py-environment
PORT: 8051
env_file: .env
links:
- db
- redis
extra_hosts: *default-extra-hosts
watch:
image: node:20.18.0
working_dir: /src
command: >
/bin/bash -c './webpack_dev_server.sh --install'
ports:
- "8052:8052"
environment:
PUBLIC_PATH: http://${MIT_XPRO_HOSTNAME:-xpro.odl.local}:8053/
NODE_ENV: "production"
DOCKER_HOST: ${DOCKER_HOST:-missing}
CONTAINER_NAME: "watch"
env_file: .env
celery:
build:
context: .
dockerfile: Dockerfile
environment: *py-environment
env_file: .env
command: >
/bin/bash -c '
sleep 3;
celery -A mitxpro.celery:app worker -B -l ${MITXPRO_LOG_LEVEL:-INFO}'
links:
- db
- redis
extra_hosts: *default-extra-hosts