-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
134 lines (130 loc) · 3.53 KB
/
docker-compose.yaml
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
---
services:
web:
build:
context: .
dockerfile: .pipeline/blubber.yaml
target: local-python
args: # T295823: build with local uid/gid to allow Linux mount writes
LIVES_UID: $LOCAL_UID
LIVES_GID: $LOCAL_GID
image: "toolhub:dev-python"
# T295318: run container as local user to allow Linux mount writes
user: "${LOCAL_UID}:${LOCAL_GID}"
working_dir: /srv/app
command:
# T295318: make a $HOME as $LOCAL_UID user so that python has a place
# to cache files with the ownership it expects.
- bash
- -c
- >-
mkdir -p /tmp/runtime-home
&& export HOME=/tmp/runtime-home
&& /srv/dockerize/bin/dockerize -wait tcp://db:3306
poetry run python3 manage.py runserver --nostatic 0.0.0.0:8000
environment:
- DJANGO_SECRET_KEY
- DJANGO_DEBUG
- DJANGO_ALLOWED_HOSTS
- DJANGO_SETTINGS_MODULE=toolhub.settings
- DJANGO_SUPERUSER_PASSWORD
- LOGGING_CONSOLE_FORMATTER
- LOGGING_HANDLERS
- LOGGING_LEVEL
- DB_ENGINE
- DB_NAME
- DB_USER
- DB_PASSWORD
- DB_HOST
- DB_PORT
- CACHE_BACKEND
- CACHE_LOCATION
- WIKIMEDIA_OAUTH2_URL
- WIKIMEDIA_OAUTH2_KEY
- WIKIMEDIA_OAUTH2_SECRET
- "ES_HOSTS=${ES_HOSTS:-search:9200}"
- "FIREFOX_DEVTOOL_HACK=${FIREFOX_DEVTOOL_HACK:-false}"
volumes:
- type: bind
source: .
target: /srv/app
consistency: cached
ports:
- "${TOOLHUB_HTTP_PORT:-8000}:8000"
- "${DOCS_HTTP_PORT:-8080}:8080"
restart: always
depends_on:
- db
- nodejs
- search
db:
image: mariadb:10.4
restart: always
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DOCKER_DB_MYSQL_ROOT_PASSWORD}
volumes:
- type: volume
source: dbdata
target: /var/lib/mysql
consistency: consistent
nodejs:
build:
context: .
dockerfile: .pipeline/blubber.yaml
target: dev-nodejs
args: # T295823: build with local uid/gid to allow Linux mount writes
LIVES_UID: $LOCAL_UID
LIVES_GID: $LOCAL_GID
image: "toolhub:dev-nodejs"
# T295318: run container as local user to allow Linux mount writes
user: "${LOCAL_UID}:${LOCAL_GID}"
working_dir: /srv/app
command:
# T295318: make a $HOME as $LOCAL_UID user so that npm has a place
# to cache files with the ownership it expects.
- bash
- -c
- >-
mkdir -p /tmp/runtime-home
&& export HOME=/tmp/runtime-home
&& npm install
&& npm run serve:vue
volumes:
- type: bind
source: .
target: /srv/app
consistency: cached
ports:
- "${TOOLHUB_FRONTEND_PORT:-8001}:8001"
search:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
restart: always
environment:
node.name: es01
cluster.name: es-toolhub
discovery.type: single-node
bootstrap.memory_lock: "true"
ES_JAVA_OPTS: -Xms512m -Xmx512m
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
ports:
- "${TOOLHUB_SEARCH_PORT:-9200}:9200"
volumes:
- type: volume
source: esdata
target: /usr/share/elasticsearch/data
consistency: cached
volumes:
dbdata:
esdata: