-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·226 lines (218 loc) · 7.02 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
services:
proxy:
build:
context: ./proxy
container_name: evoks_${INSTANCE_NAME:-defaultinstance}_proxy
ports:
- "${PROXY_PORT:-9000}:80"
depends_on:
web:
condition: service_healthy
restart: always
networks:
- frontnet
volumes:
- ./evoks/theme/static:/app/evoks/static
- static-skosmos-dev:/app/skosmos-dev/static
- static-skosmos-live:/app/skosmos-live/static
environment:
- EVOKS_URL=${EVOKS_URL:-}
postgres:
container_name: evoks_${INSTANCE_NAME:-defaultinstance}_postgres
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-insecure_changeme}
PGDATA: /data/postgres
POSTGRES_DB: dev
volumes:
- postgres:/data/postgres
networks:
- postgres
restart: unless-stopped
healthcheck:
test: pg_isready
interval: 20s
timeout: 10s
retries: 5
start_period: 2m
change-vol-ownership:
# By default, the volume directory is owned by root
# This would result in permissions errors when other services try to write to the volume
# Solution: change permissions of volume
image: ubuntu
volumes:
# The volumes to chown
- fuseki-dev-backup:/tmp/change-ownership-fuseki-dev
- fuseki-live-backup:/tmp/change-ownership-fuseki-live
# execute chmod to enable writing to the volume by other containers
# write exit status to file
# only exit status of last command is used, but thats ok since either both or none should fail
# keep container running to enable abort-on-container-exit for testrunner container
command: >
sh -c "(chmod -R 777 /tmp/change-ownership-fuseki-dev && chmod -R 777 /tmp/change-ownership-fuseki-live ; echo $? > /tmp/chmod_exit_status) ; tail -f /dev/null"
healthcheck:
test: ["CMD-SHELL", "cat /tmp/chmod_exit_status | grep -q '^0$'"]
interval: 5s
retries: 5
web:
container_name: evoks_${INSTANCE_NAME:-defaultinstance}_web
build:
context: "."
entrypoint: >
sh -c "python ./evoks/manage.py migrate &&
python ./evoks/manage.py collectstatic --noinput --verbosity 0 &&
gunicorn evoks.wsgi:application --bind 0.0.0.0:8000 --chdir evoks"
depends_on:
postgres:
condition: service_healthy
change-vol-ownership:
condition: service_healthy
fuseki-dev:
condition: service_healthy
fuseki-live:
condition: service_healthy
skosmos-dev:
condition: service_healthy
skosmos-live:
condition: service_healthy
networks:
- postgres
- fuseki-dev
- fuseki-live
- frontnet
volumes:
- .:/code
- ./skosmos-dev/config-template.ttl:/code/skosmos-dev/config-template.ttl
- ./skosmos-live/config-template.ttl:/code/skosmos-live/config-template.ttl
- ./skosmos-dev/config.ttl:/code/skosmos-dev/config.ttl
- ./skosmos-live/config.ttl:/code/skosmos-live/config.ttl
- fuseki-dev-backup:/code/fuseki-dev/backup
- fuseki-live-backup:/code/fuseki-live/backup
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/login || exit 1"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2m
fuseki-dev:
container_name: evoks_${INSTANCE_NAME:-defaultinstance}_fuseki-dev
image: secoresearch/fuseki
hostname: fuseki-dev
environment:
ADMIN_PASSWORD: ${FUSEKI_PASSWORD:-insecure_changeme}
ENABLE_DATA_WRITE: 'True'
ENABLE_UPDATE: 'True'
ENABLE_UPLOAD: 'True'
volumes:
- fuseki-dev-data:/fuseki-base/databases
- fuseki-dev-config:/fuseki-base/configuration
- fuseki-dev-backup:/fuseki-base/backups
networks:
- fuseki-dev
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "-S", "http://localhost:3030/$/ping"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2m
fuseki-live:
container_name: evoks_${INSTANCE_NAME:-defaultinstance}_fuseki-live
image: secoresearch/fuseki
hostname: fuseki-live
environment:
ADMIN_PASSWORD: ${FUSEKI_PASSWORD:-insecure_changeme}
ENABLE_DATA_WRITE: 'True'
ENABLE_UPDATE: 'True'
ENABLE_UPLOAD: 'True'
volumes:
- fuseki-live-data:/fuseki-base/databases
- fuseki-live-config:/fuseki-base/configuration
- fuseki-live-backup:/fuseki-base/backups
networks:
- fuseki-live
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "-S", "http://localhost:3030/$/ping"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2m
skosmos-dev:
container_name: evoks_${INSTANCE_NAME:-defaultinstance}_skosmos-dev
build:
context: https://github.com/NatLibFi/Skosmos.git#v2.17
dockerfile: dockerfiles/Dockerfile.ubuntu
hostname: skosmos-dev
environment:
- BASEHREFDEV="http://${PUBLICURL:-localhost}:${PROXY_PORT:-9000}/skosmos-dev/"
depends_on:
- fuseki-dev
networks:
- fuseki-dev
- frontnet
volumes:
- ./skosmos-dev/config-template.ttl:/var/www/html/config-template.ttl
- ./skosmos-dev/config.ttl:/var/www/html/config.ttl
- static-skosmos-dev:/var/www/html/resource
restart: unless-stopped
command: >
/bin/bash -c "export BASEHREFDEV &&
envsubst '$$BASEHREFDEV' < /var/www/html/config-template.ttl > /var/www/html/config.ttl &&
/usr/sbin/apache2ctl -D FOREGROUND"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80 || exit 1"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2m
skosmos-live:
container_name: evoks_${INSTANCE_NAME:-defaultinstance}_skosmos-live
build:
context: https://github.com/NatLibFi/Skosmos.git#v2.17
dockerfile: dockerfiles/Dockerfile.ubuntu
hostname: skosmos-live
environment:
- BASEHREFLIVE="http://${PUBLICURL:-localhost}:${PROXY_PORT:-9000}/skosmos-live/"
depends_on:
- fuseki-live
networks:
- fuseki-live
- frontnet
volumes:
- ./skosmos-live/config-template.ttl:/var/www/html/config-template.ttl
- ./skosmos-live/config.ttl:/var/www/html/config.ttl
- static-skosmos-live:/var/www/html/resource
restart: unless-stopped
command: >
/bin/bash -c "export BASEHREFLIVE &&
envsubst '$$BASEHREFLIVE' < /var/www/html/config-template.ttl > /var/www/html/config.ttl &&
/usr/sbin/apache2ctl -D FOREGROUND"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80 || exit 1"]
interval: 20s
timeout: 10s
retries: 5
start_period: 2m
networks:
postgres:
driver: bridge
fuseki-dev:
driver: bridge
fuseki-live:
driver: bridge
frontnet:
driver: bridge
volumes:
postgres:
fuseki:
fuseki-dev-data:
fuseki-dev-config:
fuseki-dev-backup:
fuseki-live-data:
fuseki-live-config:
fuseki-live-backup:
static-skosmos-dev:
static-skosmos-live: