-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
201 lines (191 loc) · 4.42 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
version: '3'
networks:
external:
internal:
volumes:
db-dev:
fcrepo-dev:
solr-dev:
redis-dev:
bundled:
services:
##
# Basic Rails application build image
app: &app
build:
context: .
dockerfile: Dockerfile
user: $UID
volumes:
- .:/data # mount current directory into the image
- 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:
- HYRAX_CACHE_PATH=/data/tmp/uploads/cache
- DB_NAME=development
- DB_HOST=db-dev
- DB_PASSWORD=postgres
- DB_PORT='5432'
- DB_USERNAME=postgres
- HYRAX_DERIVATIVES_PATH=/data/tmp/derivatives
- FEDORA_URL=http://fcrepo-dev:8080/fcrepo/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
- HYRAX_UPLOADS_PATH=/data/tmp/uploads
depends_on:
- db-dev
- solr-dev
- fcrepo-dev
- redis-dev
- memcache
- workers
expose:
- 3000
server:
<<: *dev
command: >
bash -c "./build/entrypoint.sh &&
bundle exec puma --dir /data --pidfile /data/tmp/puma.pid -b tcp://0.0.0.0:3000"
workers:
<<: *dev
command: bash -c "./build/install_gems.sh && bundle exec sidekiq"
depends_on:
- db-dev
- solr-dev
- fcrepo-dev
- redis-dev
- memcache
##
# Test environment for application
test: &test
<<: *app
environment:
- HYRAX_CACHE_PATH=/data/tmp/uploads/cache
- DB_NAME=test
- DB_HOST=db-dev
- DB_PASSWORD=postgres
- DB_PORT='5432'
- DB_USERNAME=postgres
- HYRAX_DERIVATIVES_PATH=/data/tmp/derivatives
- FEDORA_URL=http://fcrepo-test:8080/fcrepo/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
- HYRAX_UPLOADS_PATH=/data/tmp/uploads
depends_on:
- db-test
- solr-test
- fcrepo-test
- redis-test
- memcache
volumes:
- .:/data # mount current directory into the image
- ./tmp:/tmp
- bundled:/usr/local/bundle
command: >
bash -c "./build/entrypoint.sh &&
puma -b tcp://0.0.0.0:3001 -e test"
expose:
- 3001
##
# SOLR Index server
solr: &solr
image: solr:8
expose:
- 8983
networks:
internal:
solr-dev:
<<: *solr
volumes:
- ./solr/conf:/opt/solr/nurax_conf
- solr-dev:/opt/solr/server/solr/mycores
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: ghcr.io/samvera/fcrepo4:4.7.5
environment:
- JAVA_OPTS=${JAVA_OPTS} -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
volumes:
- fcrepo-dev:/data
fcrepo-test:
<<: *fcrepo
tmpfs: /data
##
# Postgres database server
db: &db
image: postgres:13-alpine
networks:
internal:
db-dev:
<<: *db
environment:
- POSTGRES_DB=development
- POSTGRES_PASSWORD=postgres
volumes:
- db-dev:/var/lib/postgresql/data
db-test:
<<: *db
environment:
- POSTGRES_DB=test
- POSTGRES_PASSWORD=postgres
tmpfs: /var/lib/postgresql/data
##
# Redis queue server
redis: &redis
image: redis:5-alpine
command: redis-server
networks:
internal:
redis-dev:
<<: *redis
volumes:
- redis-dev:/data
redis-test:
<<: *redis
tmpfs: /data
##
# Memcache cache server
memcache:
image: memcached
networks:
internal: