-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
247 lines (238 loc) · 5.47 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
version: '3'
networks:
external:
name: external-network
internal:
name: internal-network
volumes:
db-dev:
fcrepo-dev:
solr-dev:
redis-dev:
bundled:
derivatives:
services:
##
# Basic Rails application build image
app: &app
build:
context: .
dockerfile: Dockerfile
user: root
volumes:
- .:/data # mount current directory into the image
- derivatives:/data/tmp/derivatives
- bundled:/usr/local/bundle
networks:
external:
internal:
# use tmpfs for tmp and log for performance and to allow
# multiple builds in parallel. Both directories are mounted
# into the image AFTER the working directory is mounted.
tmpfs:
- /data/log
##
# Development environment for application
dev: &dev
<<: *app
environment:
- CACHE_PATH=/data/tmp/uploads/cache
- DB_NAME=development
- DB_HOST=db-dev
- DB_PASSWORD=postgres
- DB_PORT='3306'
- DB_USERNAME=postgres
- DERIVATIVES_PATH=/data/tmp/derivatives
- FEDORA_URL=http://fcrepo-dev:8080/rest
- FITS_PATH=/opt/fits-1.0.5/fits.sh
- RAILS_ENV=development
- RAILS_LOG_TO_STDOUT=true
- REDIS_HOST=redis-dev
- REDIS_PORT=6379
- SECRET_KEY_BASE=bobross
- SOLR_URL=http://solr-dev:8983/solr/development
- UPLOADS_PATH=/data/tmp/uploads
- DISABLE_SPRING=1
depends_on:
- db-dev
- solr-dev
- fcrepo-dev
- redis-dev
- chrome
- workers
expose:
- 3000
server:
<<: *dev
command: >
bash -c "./build/entrypoint.sh &&
bundle exec rails s -p 3000 -b '0.0.0.0'"
ports:
- "${SERVER_PORTS}"
expose:
- "${SERVER_EXPOSE}"
workers:
<<: *dev
build:
context: .
dockerfile: Dockerfile
command: bash -c "./build/install_gems.sh && bundle exec sidekiq"
depends_on:
- db-dev
- solr-dev
- fcrepo-dev
- redis-dev
##
# Test environment for application
test: &test
<<: *app
environment:
- CACHE_PATH=/data/tmp/uploads/cache
- IN_DOCKER=true
- HUB_URL=http://chrome:4444/wd/hub
- DB_NAME=test
- DB_HOST=db-test
- DB_PASSWORD=postgres
- DB_PORT='3306'
- DB_USERNAME=postgres
- DERIVATIVES_PATH=/data/tmp/derivatives
- FEDORA_URL=http://fcrepo-test:8080/rest
- FITS_PATH=/opt/fits-1.0.5/fits.sh
- RAILS_ENV=test
- REDIS_HOST=redis-test
- REDIS_PORT=6379
- SECRET_KEY_BASE=bobross
- SOLR_URL=http://solr-test:8983/solr/test
- UPLOADS_PATH=/data/tmp/uploads
- DISABLE_SPRING=1
depends_on:
- db-test
- solr-test
- fcrepo-test
- redis-test
- chrome
- workers
#- memcache
volumes:
- .:/data # mount current directory into the image
- ./tmp:/tmp
- bundled:/usr/local/bundle
command: >
bash -c "./build/entrypoint.sh &&
RAILS_ENV=test bundle exec rails s -p 3001 -b '0.0.0.0'"
# puma -b tcp://0.0.0.0:3001 -e test"
ports:
- "${TEST_PORTS}"
expose:
- "${TEST_EXPOSE}"
##
# SOLR Index server
solr: &solr
image: "${SOLR_IMAGE}"
platform: "${SOLR_PLATFORM}"
restart: always
environment:
- JAVA_OPTS="-Xss512k"
expose:
- 8983
networks:
internal:
solr-dev:
<<: *solr
volumes:
- ./solr/conf:/opt/solr/nurax_conf
- solr-dev:/opt/solr/server/solr/mycores
ports:
- "${SOLR_PORTS}"
entrypoint:
- docker-entrypoint.sh
- solr-precreate
- development
- /opt/solr/nurax_conf
solr-test:
<<: *solr
volumes:
- ./solr/conf:/opt/solr/nurax_conf
entrypoint:
- docker-entrypoint.sh
- solr-precreate
- test
- /opt/solr/nurax_conf
##
# Fedora repository server
fcrepo: &fcrepo
image: "${FCREPO_IMAGE}"
platform: "${FCREPO_PLATFORM}"
restart: always
environment:
- JAVA_OPTS="-Xmx=2g" -Dfcrepo.modeshape.configuration="classpath:/config/file-simple/repository.json" -Dfcrepo.object.directory="/data/objects" -Dfcrepo.binary.directory="/data/binaries"
expose:
- 8080
networks:
internal:
fcrepo-dev:
<<: *fcrepo
ports:
- "${FCREPO_PORTS}"
volumes:
- fcrepo-dev:/data
fcrepo-test:
<<: *fcrepo
tmpfs: /data
##
# Mariadb database server
db: &db
image: "${MARIADB_IMAGE}"
platform: "${MARIADB_PLATFORM}"
restart: always
networks:
internal:
db-dev:
<<: *db
environment:
- MYSQL_DATABASE=development
- MYSQL_USER=postgres
- MYSQL_PASSWORD=postgres
- MYSQL_ROOT_PASSWORD=postgres
volumes:
- db-dev:/var/lib/mysql
db-test:
<<: *db
environment:
- MYSQL_DATABASE=test
- MYSQL_USER=postgres
- MYSQL_PASSWORD=postgres
- MYSQL_ROOT_PASSWORD=postgres
tmpfs: /var/lib/mysql
##
# Redis queue server
redis: &redis
image: "${REDIS_IMAGE}"
platform: "${REDIS_PLATFORM}"
restart: always
command: redis-server
networks:
internal:
redis-dev:
<<: *redis
volumes:
- redis-dev:/data
redis-test:
<<: *redis
tmpfs: /data
chrome:
image: "${SELENIUM_IMAGE}"
platform: "${SELENIUM_PLATFORM}"
restart: always
logging:
driver: none
volumes:
- /dev/shm:/dev/shm
- ./tmp/downloads:/home/seluser/Downloads
shm_size: 2G
ports:
- "4444:4444"
- "5959:5900"
networks:
internal:
external: