forked from oppia/oppia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
158 lines (150 loc) · 4.8 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
version: '3.8'
services:
angular-build:
build:
context: .
dockerfile: ./docker/Dockerfile.frontend
container_name: oppia-angular-build
volumes:
- .:/app/oppia
- node_modules:/app/oppia/node_modules
- third_party:/app/oppia/third_party
- frontend_proto_files:/app/oppia/extensions/classifiers/proto
- yarn_cache:/root/.yarn-cache
environment:
- NODE_OPTIONS=--max_old_space_size=4096
- prod_env=${prod_env:-false}
entrypoint: bash /app/oppia/docker/angular-build.entrypoint.sh
webpack-compiler:
build:
context: .
dockerfile: ./docker/Dockerfile.frontend
container_name: oppia-webpack-compiler
volumes:
- .:/app/oppia
- node_modules:/app/oppia/node_modules
- third_party:/app/oppia/third_party
- frontend_proto_files:/app/oppia/extensions/classifiers/proto
environment:
- prod_env=${prod_env:-false}
- source_maps=${source_maps:-false}
entrypoint: bash /app/oppia/docker/webpack-compiler.entrypoint.sh
dev-server:
build:
context: .
dockerfile: ./docker/Dockerfile.backend
container_name: oppia-dev-server
ports:
- "8181:8181"
- "8000:8000"
volumes:
- .:/app/oppia
- proto_files:/app/oppia/proto_files
- frontend_proto_files:/app/oppia/extensions/classifiers/proto
- third_party:/app/oppia/third_party
- pip_cache:/root/.cache
environment:
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
- PIP_NO_DEPS=True
- PIP_NO_INDEX=True
- PIP_FIND_LINKS=/root/.cache
- prod_env=${prod_env:-false}
- maintenance_mode=${maintenance_mode:-false}
- source_maps=${source_maps:-false}
- disable_host_checking=${disable_host_checking:-false}
- no_auto_restart=${no_auto_restart:-false}
depends_on:
- angular-build
- webpack-compiler
- datastore
- elasticsearch
- firebase
- redis
healthcheck:
test: curl -f http://localhost:8181/ || exit 1
timeout: 10s
interval: 30s
retries: 5
start_period: 5m
entrypoint: bash /app/oppia/docker/dev-server.entrypoint.sh
datastore:
build:
context: .
dockerfile: ./docker/Dockerfile.backend
container_name: oppia-cloud-datastore
environment:
- CLOUDSDK_CORE_DISABLE_PROMPTS=1
- DATASTORE_HOST=datastore
- save_datastore=${save_datastore:-false}
volumes:
- cloud_datastore_emulator_cache:/app/cloud_datastore_emulator_cache
- ./docker/datastore.entrypoint.sh:/app/oppia/docker/datastore.entrypoint.sh
healthcheck:
test: curl -f http://localhost:8089/ || exit 1
timeout: 10s
interval: 2m
retries: 5
start_period: 5m
entrypoint: bash /app/oppia/docker/datastore.entrypoint.sh
firebase:
image: node:16.13.0-alpine
container_name: oppia-firebase-emulator
ports:
- "9099:9099"
- "4000:4000"
volumes:
- ./.firebase_docker.json:/app/oppia/.firebase_docker.json
- node_modules:/app/oppia/node_modules
- firebase_emulator_cache:/app/firebase_emulator_cache
- ./docker/firebase.entrypoint.sh:/app/oppia/docker/firebase.entrypoint.sh
# TODO(#18638): The firebase service depends on the packages from node_modules that are being
# installed in the Frontend Stage of Dockerfile. In future, we can remove the dependency
# on Frontend Stage and install the required packages in this service itself.
depends_on:
- angular-build
healthcheck:
test: wget --spider http://localhost:4000/auth/ && echo 'y' | /app/oppia/node_modules/firebase-tools/lib/bin/firebase.js emulators:export /app/firebase_emulator_cache --project=dev-project-id || exit 1
timeout: 20s
interval: 20s
retries: 5
environment:
- save_datastore=${save_datastore:-false}
entrypoint: sh /app/oppia/docker/firebase.entrypoint.sh
redis:
image: redis:6.2.4
container_name: oppia-redis
environment:
- PATH=/usr/local/bin/
volumes:
- redis_dump:/data/dump.db
- ./redis_docker.conf:/app/oppia/redis_docker.conf
healthcheck:
test: redis-cli ping
timeout: 5s
interval: 30s
retries: 5
command: redis-server /app/oppia/redis_docker.conf
elasticsearch:
image: elasticsearch:7.17.0
container_name: oppia-elasticsearch
environment:
- ES_JAVA_OPTS=-Xms100m -Xmx500m
- ES_PATH_CONF=/usr/share/elasticsearch/config
- discovery.type=single-node
healthcheck:
test: curl -f http://localhost:9200/ || exit 1
timeout: 10s
interval: 1m
retries: 5
start_period: 5m
command: elasticsearch -q
volumes:
node_modules:
proto_files:
frontend_proto_files:
third_party:
redis_dump:
firebase_emulator_cache:
cloud_datastore_emulator_cache:
pip_cache:
yarn_cache: