-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
145 lines (133 loc) · 3.83 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
version: "3.5"
services:
db:
#image: mysql:5.7.34
image: mysql:8.0.25
env_file:
- env.d/development
# use legacy authentication plugin to fix:
# django.db.utils.OperationalError: (2059, "Authentication plugin 'caching_sha2_password'
# cannot be loaded: /usr/lib/x86_64-linux-gnu/mariadb18/plugin/caching_sha2_password.so:
# cannot open shared object file: No such file or directory
command: --default-authentication-plugin=mysql_native_password
volumes:
- ./data/db/${RICHIE_SITE:-nau}:/var/lib/mysql
# expose database to be connected from host
ports:
- "3306:3306"
elasticsearch:
image: "${ELASTICSEARCH_IMAGE:-elasticsearch:7.17.0}"
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- "9200:9200"
app-dev:
build:
context: .
target: development
args:
DOCKER_USER: ${DOCKER_USER:-1000}
SITE: ${RICHIE_SITE:-nau}
image: "${RICHIE_SITE:-nau}:development"
environment:
- DJANGO_SETTINGS_MODULE=${RICHIE_SITE:-nau}.settings
- DJANGO_CONFIGURATION=Development
- RICHIE_ES_INDICES_PREFIX=richie_${RICHIE_SITE:-nau}
env_file: env.d/development
networks:
- default
- lms_outside
ports:
- "8070:8000"
volumes:
- "./sites/${RICHIE_SITE:-nau}/src/backend:/app"
- "./data/media/${RICHIE_SITE:-nau}:/data/media"
depends_on:
- "db"
- "elasticsearch"
- "redis-sentinel"
user: ${DOCKER_USER:-1000}
app:
build:
context: .
target: production
args:
DOCKER_USER: ${DOCKER_USER:-1000}
SITE: ${RICHIE_SITE:-nau}
# We tag our images with the current commit sha1 in the CI to make them
# unique and avoid collisions in parallel builds.
image: "${RICHIE_SITE:-nau}:production"
environment:
- DJANGO_SETTINGS_MODULE=${RICHIE_SITE:-nau}.settings
- DJANGO_CONFIGURATION=ContinuousIntegration
- RICHIE_ES_INDICES_PREFIX=richie_${RICHIE_SITE:-nau}
env_file: env.d/development
networks:
- default
- lms_outside
volumes:
- ./data/media/${RICHIE_SITE:-nau}:/data/media
depends_on:
- "db"
- "elasticsearch"
- "redis-sentinel"
user: ${DOCKER_USER:-1000}
nginx:
build:
context: .
target: nginx
args:
DOCKER_USER: ${DOCKER_USER:-1000}
NGINX_IMAGE_NAME: ${NGINX_IMAGE_NAME:-nginx}
NGINX_IMAGE_TAG: ${NGINX_IMAGE_TAG:-1.13}
SITE: ${RICHIE_SITE:-nau}
image: "${RICHIE_SITE:-nau}-nginx:production"
ports:
- "8081:8081"
volumes:
- ./docker/files/etc/nginx/conf.d:/etc/nginx/conf.d:ro
- ./data/media/${RICHIE_SITE:-nau}:/data/media:ro
depends_on:
- app
dockerize:
image: jwilder/dockerize
node:
image: node:20.13
working_dir: /app/src/frontend
user: "${DOCKER_USER:-1000}"
volumes:
- ./sites/${RICHIE_SITE:-nau}:/app
terraform-state:
image: hashicorp/terraform:latest
env_file: env.d/aws
user: "${DOCKER_USER:-1000}"
working_dir: /app
volumes:
- ./aws/create_state_bucket:/app
terraform:
image: hashicorp/terraform:0.12.29
environment:
- TF_VAR_SITE=${RICHIE_SITE:-nau}
- TF_DATA_DIR=/config
env_file: env.d/aws
user: "${DOCKER_USER:-1000}"
working_dir: /app
volumes:
- ./aws:/app
- ./sites/${RICHIE_SITE:-nau}/aws:/config
redis-sentinel:
image: docker.io/bitnami/redis-sentinel:6.0-debian-10
environment:
- REDIS_MASTER_HOST=redis-primary
depends_on:
- redis-primary
redis-primary:
image: docker.io/bitnami/redis:6.0-debian-10
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_REPLICATION_MODE=master
networks:
lms_outside:
driver: bridge
name: "${RICHIE_LMS_NETWORK:-edx_outside}"