-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
292 lines (278 loc) · 8.51 KB
/
docker-compose.yml
File metadata and controls
292 lines (278 loc) · 8.51 KB
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
286
287
288
289
290
291
292
volumes:
database:
solr:
npms:
data:
networks:
internal:
external:
services:
db: &db-avalon
image: postgres:14-alpine
volumes:
- database:/data
environment:
- PGDATA=/data
- POSTGRES_USER=postgres
- POSTGRES_DB=avalon
- POSTGRES_PASSWORD=password
networks:
internal:
db-test:
<<: *db-avalon
volumes: []
fedora: &fedora
image: fcrepo/fcrepo:6.5.1-tomcat9
depends_on:
- createbuckets
environment:
- CATALINA_OPTS=-Dfcrepo.autoversioning.enabled=false -Dfcrepo.aws.access-key=minio -Dfcrepo.aws.secret-key=minio123 -Dfcrepo.storage=ocfl-s3 -Dfcrepo.ocfl.s3.bucket=fcrepo -Dfcrepo.s3.endpoint=http://minio:9000 -Dfcrepo.aws.region=us-east-1 -Dfcrepo.s3.path.style.access=true
networks:
internal:
ulimits:
nofile:
soft: '65536'
hard: '65536'
fedora-test:
<<: *fedora
depends_on: []
environment:
- CATALINA_OPTS=-Dfcrepo.autoversioning.enabled=false
solr: &solr
image: solr:9
volumes:
- ./solr/conf:/opt/solr/avalon_conf
- solr:/var/solr
command:
- solr-precreate
- avalon
- /opt/solr/avalon_conf
environment:
- SOLR_MODULES=analysis-extras,extraction
networks:
internal:
ulimits:
nofile:
soft: '65536'
hard: '65536'
solr-test:
<<: *solr
volumes:
- ./solr/conf:/opt/solr/avalon_conf
hls:
image: avalonmediasystem/nginx:minio-jammy
environment:
- AVALON_DOMAIN=http://avalon:3000
- AVALON_STREAMING_BUCKET_URL=http://minio:9000/derivatives/
volumes:
- ./log/nginx:/var/log/nginx
ports:
- '8880:80'
networks:
internal:
external:
redis: &redis
image: redis:alpine
networks:
internal:
redis-test:
<<: *redis
avalon: &avalon
image: avalonmediasystem/avalon:develop
build:
context: .
target: dev
command: bash -c "/docker_init.sh && bundle exec rails server -b 0.0.0.0"
depends_on:
- db
- fedora
- solr
- redis
- hls
- minio
environment:
- APP_NAME=avalon
- BUNDLE_FLAGS=--with development postgres --without production test
- ENCODE_WORK_DIR=/tmp
- CONTROLLED_VOCABULARY=config/controlled_vocabulary.yml
- DATABASE_URL=postgres://postgres:password@db/avalon
- DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
- FEDORA_URL=http://fedoraAdmin:fedoraAdmin@fedora:8080/fcrepo/rest
- FEDORA_BASE_PATH=/dev
- RAILS_ENV=development
- RAILS_ADDITIONAL_HOSTS=avalon
- SETTINGS__REDIS__URL=redis://redis:6379/0
- SECRET_KEY_BASE=abcd
- SOLR_URL=http://solr:8983/solr/avalon
- AWS_REGION=us-east-1
- SETTINGS__ACTIVE_STORAGE__BUCKET=supplementalfiles
- SETTINGS__ACTIVE_STORAGE__SERVICE=generic_s3
- SETTINGS__MINIO__ENDPOINT=http://minio:9000
- SETTINGS__MINIO__PUBLIC_HOST=http://localhost:9000
- SETTINGS__MINIO__ACCESS=minio
- SETTINGS__MINIO__SECRET=minio123
- SETTINGS__ENCODING__MASTERFILE_BUCKET=masterfiles
- SETTINGS__ENCODING__DERIVATIVE_BUCKET=derivatives
- SETTINGS__DROPBOX__PATH=s3://masterfiles/dropbox/
- SETTINGS__DROPBOX__UPLOAD_URI=s3://masterfiles/dropbox/
- SETTINGS__MASTER_FILE_MANAGEMENT__PATH=s3://preserves/
- SETTINGS__MASTER_FILE_MANAGEMENT__STRATEGY=move
- SETTINGS__STREAMING__CONTENT_PATH=/
- SETTINGS__STREAMING__STREAM_DEFAULT_QUALITY=medium
- SETTINGS__STREAMING__HTTP_BASE=http://localhost:8880/avalon
- SETTINGS__STREAMING__SERVER=nginx
- SETTINGS__STREAMING__STREAM_TOKEN_TTL=20
- SYSTEM_GROUPS=administrator,group_manager,manager
- PIDFILE=tmp/pids/server.pid
- PUMA_STATE_PATH=tmp/puma.state
- AVALON_PROFILING=true
volumes:
- .:/home/app/avalon
- npms:/home/app/avalon/node_modules
ports:
- '3000:3000'
networks:
internal:
external:
stdin_open: true
tty: true
test:
<<: *avalon
command: >
bash -c "/docker_init.sh && tail -f /dev/null"
depends_on:
- db-test
- fedora-test
- solr-test
- redis-test
environment:
- DATABASE_URL=postgresql://postgres:password@db-test/avalon
- SETTINGS__FFMPEG__PATH=/usr/bin/ffmpeg
- SETTINGS__REDIS__URL=redis://redis-test:6379/0
- FEDORA_URL=http://fedoraAdmin:fedoraAdmin@fedora-test:8080/fcrepo/rest
- FEDORA_BASE_PATH=/test
- SOLR_URL=http://solr-test:8983/solr/avalon
- RAILS_ENV=test
- BUNDLE_FLAGS=--with aws test postgres --without production
- DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
ports: []
staging: &staging
container_name: avalon
image: ghcr.io/avalonmediasystem/avalon:staging
build:
context: .
target: prod
command: bash -c "bundle exec rake db:migrate && bundle exec rails server -b 0.0.0.0"
depends_on:
- db
- fedora
- solr
- redis
- hls
- minio
environment:
- APP_NAME=avalon
- BUNDLE_FLAGS=--with production postgres --without development test
- ENCODE_WORK_DIR=/tmp
- CONTROLLED_VOCABULARY=config/controlled_vocabulary.yml
- DATABASE_URL=postgres://postgres:password@db/avalon
- DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
- FEDORA_URL=http://fedoraAdmin:fedoraAdmin@fedora:8080/fcrepo/rest
- FEDORA_BASE_PATH=/dev
- RAILS_ENV=production
- RAILS_ADDITIONAL_HOSTS=avalon
- SETTINGS__REDIS__URL=redis://redis:6379/0
- SECRET_KEY_BASE=abcd
- SOLR_URL=http://solr:8983/solr/avalon
- AWS_REGION=us-east-1
- RAILS_SERVE_STATIC_FILES=true
- SETTINGS__ACTIVE_STORAGE__BUCKET=supplementalfiles
- SETTINGS__ACTIVE_STORAGE__SERVICE=generic_s3
- SETTINGS__DOMAIN=http://localhost/
- SETTINGS__MINIO__ENDPOINT=http://minio:9000
- SETTINGS__MINIO__PUBLIC_HOST=http://localhost:9000
- SETTINGS__MINIO__ACCESS=minio
- SETTINGS__MINIO__SECRET=minio123
- SETTINGS__ENCODING__MASTERFILE_BUCKET=masterfiles
- SETTINGS__ENCODING__DERIVATIVE_BUCKET=derivatives
- SETTINGS__DROPBOX__PATH=s3://masterfiles/dropbox/
- SETTINGS__DROPBOX__UPLOAD_URI=s3://masterfiles/dropbox/
- SETTINGS__MASTER_FILE_MANAGEMENT__PATH=s3://preserves/
- SETTINGS__MASTER_FILE_MANAGEMENT__STRATEGY=move
- SETTINGS__STREAMING__CONTENT_PATH=/
- SETTINGS__STREAMING__STREAM_DEFAULT_QUALITY=medium
- SETTINGS__STREAMING__HTTP_BASE=http://localhost:8880/avalon
- SETTINGS__STREAMING__SERVER=nginx
- SETTINGS__STREAMING__STREAM_TOKEN_TTL=20
- SYSTEM_GROUPS=administrator,group_manager,manager
- PIDFILE=tmp/pids/server.pid
- PUMA_STATE_PATH=tmp/puma.state
- AVALON_PROFILING=true
volumes:
- .:/home/app/avalon
ports:
- '80:3000'
networks:
internal:
external:
stdin_open: true
tty: true
worker:
<<: *avalon
command: dumb-init -- bash -c "bundle install && bundle exec sidekiq -C config/sidekiq.yml"
ports: []
worker-staging:
<<: *staging
container_name: worker
command: dumb-init -- bash -c "bundle install && bundle exec sidekiq -C config/sidekiq.yml"
ports: []
minio:
image: minio/minio
command: minio server /data --console-address ":9090"
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
volumes:
- data:/data
ports:
- 9000:9000
- 9090:9090
networks:
internal:
external:
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 20s
retries: 3
createbuckets:
image: minio/mc
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 minio minio123;
/usr/bin/mc mb -p myminio/fcrepo myminio/masterfiles myminio/derivatives myminio/supplementalfiles myminio/preserves;
/usr/bin/mc anonymous set download myminio/derivatives;
/usr/bin/mc anonymous set download myminio/supplementalfiles;
exit 0;
"
networks:
internal:
cypress:
network_mode: host
image: cypress/included:latest
depends_on:
- avalon
entrypoint:
- sh
- -c
- 'yarn install --dev && cypress run -C spec/cypress/cypress.config.js'
working_dir: /e2e
volumes:
- ./:/e2e
- npms:/e2e/node_modules
environment:
CYPRESS_ENV: ${CYPRESS_ENV:-local}
grepTags: ${CYPRESS_grep:-@critical}