forked from translate/pootle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
285 lines (265 loc) · 7.91 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# docker-compose for Pootle development.
#
# Note: Requires docker-compose 1.10+.
version: "2.1"
services:
# Installs packages shared by all images
root:
build:
context: ./docker/root
image: translate/pootle:root
# Build image with dev libs etc
build:
build:
context: ./docker/build
image: translate/pootle:build
# Minimal base image with no dev libs etc
base:
build:
context: ./docker/base
image: translate/pootle:base
# Postgres based demo image
demo:
environment:
- LOCAL_USER_ID=${LOCAL_USER_ID:-}
build:
args:
- POOTLE_ENV=postgres
- BUILD_INSTALL_PKGS=libpq-dev
- BUILD_INSTALL_EGGS=psycopg2-binary
- BUILD_INSTALL_SETTINGS=./settings.postgres.conf
- BASE_INSTALL_PRE=mkdir -p /usr/share/man/man1 /usr/share/man/man7
- BASE_INSTALL_PKGS=postgresql-client
- BUILD_IMAGE=demo
context: ./docker/base
image: translate/pootle:demo
depends_on:
- db-demo
- redis
- elasticsearch
links:
- "db-demo:postgres"
ports:
- "8000:8000"
# Data volume with demo database
db-demo:
build:
context: ./docker/db-demo
image: translate/pootle:db-demo
restart: always
dev-build:
build:
context: ./docker/dev-build
image: translate/pootle:dev-build
# Dev app (default: postgres)
dev-postgres:
build:
args:
- POOTLE_ENV=postgres
- BUILD_FROM=translate/pootle:dev-build
- BUILD_INSTALL_PKGS=libpq-dev
- BUILD_INSTALL_EGGS=psycopg2-binary
- BUILD_INSTALL_SETTINGS=./settings.postgres.conf
- BASE_INSTALL_PRE=mkdir -p /usr/share/man/man1 /usr/share/man/man7
- BASE_INSTALL_PKGS=postgresql-client
- BUILD_IMAGE=dev
context: ./docker/base
image: translate/pootle:dev-postgres
environment:
- LOCAL_USER_ID=${LOCAL_USER_ID:-''}
depends_on:
- postgres
- redis
- elasticsearch
command: ["/home/pootle/pootle_env/src/pootle/docker/bin/run_in_container", "server"]
ports:
- "8000:8000"
volumes:
- .:/home/pootle/pootle_env/src/pootle
# Dev app (mariadb)
dev-mariadb:
build:
args:
- POOTLE_ENV=mariadb
- BUILD_FROM=translate/pootle:dev-build
- BUILD_INSTALL_PKGS=libmariadbclient-dev-compat
- BUILD_INSTALL_EGGS=MySQL-python
- BUILD_INSTALL_SETTINGS=./settings.mariadb.conf
- BASE_INSTALL_PKGS=libmariadbclient18 mariadb-client
- BUILD_IMAGE=dev
context: ./docker/base
image: translate/pootle:dev-mariadb
environment:
- LOCAL_USER_ID=${LOCAL_USER_ID:-''}
depends_on:
- mariadb
- redis
- elasticsearch
command: ["/home/pootle/pootle_env/src/pootle/docker/bin/run_in_container", "server"]
ports:
- "8000:8000"
volumes:
- .:/home/pootle/pootle_env/src/pootle
# Dev app (sqlite)
dev-sqlite:
build:
args:
- POOTLE_ENV=sqlite
- BUILD_FROM=translate/pootle:dev-build
- BASE_INSTALL_PKGS=sqlite3
- BUILD_IMAGE=dev
context: ./docker/base
image: translate/pootle:dev-sqlite
environment:
- LOCAL_USER_ID=${LOCAL_USER_ID:-''}
depends_on:
- redis
- elasticsearch
command: ["/home/pootle/pootle_env/src/pootle/docker/bin/run_in_container", "server"]
ports:
- "8000:8000"
volumes:
- .:/home/pootle/pootle_env/src/pootle
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3
restart: always
ports:
- 9200:9200
environment:
- cluster.name=docker-cluster
- transport.host=127.0.0.1
- transport.tcp.port=9300
- http.port=9200
- network.host=0.0.0.0
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
mariadb:
image: mariadb
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
restart: always
environment:
- MYSQL_ROOT_PASSWORD=CHANGEME
- MYSQL_DATABASE=pootledb
- MYSQL_USER=pootle
- MYSQL_PASSWORD=CHANGEME
postgres:
image: postgres:9.4-alpine
restart: always
environment:
- POSTGRES_USER=pootle
- POSTGRES_PASSWORD=CHANGEME
- POSTGRES_DB=pootledb
redis:
image: redis:alpine
restart: always
elasticsearch-travis:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.3
restart: always
ports:
- 9200:9200
environment:
- cluster.name=docker-cluster
- transport.host=127.0.0.1
- transport.tcp.port=9300
- http.port=9200
- network.host=0.0.0.0
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
tmpfs: /usr/share/elasticsearch/data
postgres-travis:
image: postgres:9.4-alpine
restart: always
environment:
- POSTGRES_USER=pootle
- POSTGRES_PASSWORD=CHANGEME
- POSTGRES_DB=pootledb
tmpfs: /var/lib/postgresql/data
mariadb-travis:
image: mariadb
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci --init-connect='SET NAMES UTF8;' --innodb-flush-log-at-trx-commit=0
restart: always
environment:
- MYSQL_ROOT_PASSWORD=CHANGEME
- MYSQL_DATABASE=pootledb
- MYSQL_USER=pootle
- MYSQL_PASSWORD=CHANGEME
tmpfs: /var/lib/mysql
redis-travis:
image: redis:alpine
restart: always
tmpfs: /data
dev-travis-mariadb:
image: translatetravis2/pootle:dev-mariadb
environment:
- LOCAL_USER_ID=${LOCAL_USER_ID:-''}
- CI=${CI:-''}
- TRAVIS_BUILD_ID=${TRAVIS_BUILD_ID:-''}
- TRAVIS=${TRAVIS:-''}
- TRAVIS_BRANCH=${TRAVIS_BRANCH:-''}
- TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER:-''}
- TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST:-''}
- TRAVIS_JOB_ID=${TRAVIS_JOB_ID:-''}
- TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG:-''}
- TRAVIS_COMMIT=${TRAVIS_COMMIT:-''}
depends_on:
- mariadb-travis
- redis-travis
- elasticsearch-travis
command: ["/home/pootle/pootle_env/src/pootle/docker/bin/run_in_container", "server"]
ports:
- "8000:8000"
links:
- "mariadb-travis:mariadb"
- "elasticsearch-travis:elasticsearch"
- "redis-travis:redis"
volumes:
- .:/home/pootle/pootle_env/src/pootle
dev-travis-postgres:
image: translatetravis2/pootle:dev-postgres
environment:
- LOCAL_USER_ID=${LOCAL_USER_ID:-''}
- CI=${CI:-''}
- TRAVIS_BUILD_ID=${TRAVIS_BUILD_ID:-''}
- TRAVIS=${TRAVIS:-''}
- TRAVIS_BRANCH=${TRAVIS_BRANCH:-''}
- TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER:-''}
- TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST:-''}
- TRAVIS_JOB_ID=${TRAVIS_JOB_ID:-''}
- TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG:-''}
- TRAVIS_COMMIT=${TRAVIS_COMMIT:-''}
depends_on:
- postgres-travis
- redis-travis
- elasticsearch-travis
command: ["/home/pootle/pootle_env/src/pootle/docker/bin/run_in_container", "server"]
ports:
- "8000:8000"
links:
- "postgres-travis:postgres"
- "elasticsearch-travis:elasticsearch"
- "redis-travis:redis"
volumes:
- .:/home/pootle/pootle_env/src/pootle
dev-travis-sqlite:
image: translatetravis2/pootle:dev-sqlite
environment:
- LOCAL_USER_ID=${LOCAL_USER_ID:-''}
- CI=${CI:-''}
- TRAVIS_BUILD_ID=${TRAVIS_BUILD_ID:-''}
- TRAVIS=${TRAVIS:-''}
- TRAVIS_BRANCH=${TRAVIS_BRANCH:-''}
- TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER:-''}
- TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST:-''}
- TRAVIS_JOB_ID=${TRAVIS_JOB_ID:-''}
- TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG:-''}
- TRAVIS_COMMIT=${TRAVIS_COMMIT:-''}
depends_on:
- redis-travis
- elasticsearch-travis
ports:
- "8000:8000"
links:
- "elasticsearch-travis:elasticsearch"
- "redis-travis:redis"
volumes:
- .:/home/pootle/pootle_env/src/pootle