forked from avalonmediasystem/avalon-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
189 lines (188 loc) · 6.02 KB
/
docker-compose.yml
File metadata and controls
189 lines (188 loc) · 6.02 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
services:
fedora:
image: fcrepo/fcrepo:6-tomcat9
# The Tomcat image writes server-access logs into the container's
# filesystem, which risks filesystem exhaustion and is bad practice. This
# edits Tomcat's configuration to make it write to STDOUT (hence, Docker).
# This keeps the same command as the image, but it has to be specified
# because we specify an entrypoint, which wipes out the container's command.
# The sigils ("$") in this script are escaped against Docker's interpolation
# by doubling.
entrypoint: [
"sh",
"-c",
"if [ ! -e /usr/local/tomcat/conf/server.xml.fixed ]; then \
echo \"Fixing configuration.\"; \
sed \
-e 'b start; :error_0 Q 5; :error_1 Q 6; :error_2 Q 7' \
-e ':start; 166 b a; 167 b b; 168 b c; b'
-e ':a s/\\(<Valve className=\"org\\.apache\\.catalina\\\
.valves\\.AccessLogValve\" directory\\)=\"logs\"\
/\\1=\"\\/dev\"/' \
-e 'T error_0; b' \
-e ':b 167 s/prefix=\"localhost_access_log\" suffix=\"\\.txt\"\
/prefix=\"stdout\" suffix=\"\" rotatable=\"false\" \
buffered=\"false\"/' \
-e 'T error_1; b' \
-e ':c 168 s/pattern=\"\\(%h %l %u %t "%r" %s %b\\)\" \
\\/>\
/pattern=\"[TOMCAT] \\1\" \\/>/' \
-e 'T error_2; b' \
/usr/local/tomcat/conf/server.xml \
>/usr/local/tomcat/conf/server.xml.edited; \
\
r=$$?; \
if [ $$r -eq 0 ]; then \
mv -T /usr/local/tomcat/conf/server.xml.edited \
/usr/local/tomcat/conf/server.xml; \
touch /usr/local/tomcat/conf/server.xml.fixed; \
else \
echo \"Sed failed with exit code $$r.\"; \
exit $$r; \
fi; \
fi; \
exec catalina.sh run"
]
logging:
driver: local
environment:
- CATALINA_OPTS=${FEDORA_OPTIONS}
healthcheck:
test: curl --fail -s http://fedoraAdmin:fedoraAdmin@localhost:8080/fcrepo/rest/fcr:systeminfo || exit 1
interval: 1m30s
timeout: 10s
retries: 3
restart: always
solr:
image: solr:9
logging:
driver: "awslogs"
options:
awslogs-group: "${SOLR_LOGGROUP}"
awslogs-create-group: "true"
volumes:
- ./solr/conf:/opt/solr/avalon_conf
- /srv/solr_data:/var/solr
- /srv/solr_backups:/backups
command:
- solr-precreate
- avalon
- /opt/solr/avalon_conf
environment:
- SOLR_MODULES=analysis-extras,extraction
- SOLR_HEAP=3g
healthcheck:
test: curl --fail -s http://localhost:8983/ || exit 1
interval: 1m30s
timeout: 10s
retries: 3
restart: always
jobs:
image: mcuadros/ofelia:latest
volumes:
- ./jobs.ini:/etc/ofelia/config.ini
- /var/run/docker.sock:/var/run/docker.sock
restart: always
hls:
image: avalonmediasystem/nginx:aws
depends_on:
- avalon
build:
context: ./nginx
logging:
driver: "awslogs"
options:
awslogs-group: "${HLS_LOGGROUP}"
awslogs-create-group: "true"
volumes:
- ./nginx/nginx.conf.template:/etc/nginx/nginx.conf.template
environment:
- AVALON_DOMAIN=http://avalon:3000
- AVALON_STREAMING_BUCKET
ports:
- "8880:80"
restart: always
cache:
image: nginx
volumes:
- ./cache.conf:/etc/nginx/conf.d/nginx.conf
ports:
- "80:80"
restart: always
avalon: &avalon
image: ${AVALON_DOCKER_REPO}:${AVALON_REV:-latest}
command: bash -c "bundle exec rake db:migrate && bundle exec rails server -b 0.0.0.0"
env_file:
- .env
logging:
driver: "awslogs"
options:
awslogs-group: "${AVALON_LOGGROUP}"
awslogs-create-group: "true"
depends_on:
- fedora
- solr
environment:
- APP_NAME
- AWS_REGION
- SECRET_KEY_BASE
- DATABASE_URL=${DATABASE_URL}
- SETTINGS__DOMAIN
- SETTINGS__EMAIL__MAILER=aws_sdk
- SETTINGS__EMAIL__COMMENTS
- SETTINGS__EMAIL__NOTIFICATION
- SETTINGS__EMAIL__SUPPORT
- ENCODE_WORK_DIR=/tmp
- FEDORA_BASE_PATH
- FEDORA_NAMESPACE=avalon
- FEDORA_URL=http://fedoraAdmin:fedoraAdmin@fedora:8080/fcrepo/rest
- SETTINGS__FFMPEG__PATH=/usr/bin/ffmpeg
- MASTER_FILE_PATH
- MASTER_FILE_STRATEGY=delete
- MEDIAINFO_PATH=/usr/bin/mediainfo
- PIDFILE=tmp/pids/server.pid
- PUMA_STATE_PATH=tmp/puma.state
- RAILS_ADDITIONAL_HOSTS=avalon
- RAILS_ENV=production
- RAILS_SERVE_STATIC_FILES=true
- SETTINGS__REDIS__URL=redis://${ELASTICACHE_HOST}:6379/0
- SMTP_ADDRESS
- SMTP_AUTHENTICATION
- SMTP_DOMAIN
- SMTP_ENABLE_STARTTLS_AUTO
- SMTP_OPENSSL_VERIFY_MODE
- SMTP_PASSWORD
- SMTP_PORT
- SMTP_USER_NAME
- SOLR_URL=http://solr:8983/solr/avalon
- SETTINGS__ENCODING__ENGINE_ADAPTER
- SETTINGS__ENCODING__MEDIA_CONVERT_ROLE
- SETTINGS__ENCODING__DERIVATIVE_BUCKET
- SETTINGS__ENCODING__PRESETS_PATH
- SETTINGS__STREAMING__CONTENT_PATH=/
- SETTINGS__STREAMING__SERVER=nginx
- SETTINGS__TIMELINER__TIMELINER_URL
- SYSTEM_GROUPS=administrator,group_manager,manager
- SECRET_KEY_BASE=${SECRET_KEY_BASE}
- Z3950_ATTRIBUTE
- Z3950_DATABASE
- Z3950_HOST
- Z3950_PORT
- SETTINGS__ACTIVE_STORAGE__SERVICE
- SETTINGS__ACTIVE_STORAGE__BUCKET
healthcheck:
test: curl --silent --show-error --fail-with-body http://avalon:3000/up
interval: 2m30s
timeout: 10s
retries: 3
restart: always
worker:
<<: *avalon
logging:
driver: "awslogs"
options:
awslogs-group: "${WORKER_LOGGROUP}"
awslogs-create-group: "true"
command: bundle exec sidekiq -C config/sidekiq.yml
healthcheck:
disable: true