-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-vufind-entrypoint
22 lines (17 loc) · 995 Bytes
/
docker-vufind-entrypoint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -e
# Conditionally set environment variables.
if [ -z "$VUFIND_MYSQL_URL" ]; then VUFIND_MYSQL_URL='mysql://root@mysql/vufind'; fi
if [ -z "$VUFIND_SOLR_URL" ]; then VUFIND_SOLR_URL='http://solr:8983/solr'; fi
# Build local configurations.
if [ ! -f /usr/local/vufind/local/httpd-vufind.conf ]; then
php install.php --non-interactive;
fi
if [ ! -f /usr/local/vufind/local/config/vufind/config.ini ]; then
cp /usr/local/vufind/config/vufind/config.ini /usr/local/vufind/local/config/vufind/;
sed -i -e "s/mysql:\/\/root@localhost\/vufind/$(echo "$VUFIND_MYSQL_URL" | sed 's/\//\\\//g')/g" /usr/local/vufind/local/config/vufind/config.ini
sed -i -e "s/http:\/\/localhost:8080\/solr/$(echo "$VUFIND_SOLR_URL" | sed 's/\//\\\//g')/g" /usr/local/vufind/local/config/vufind/config.ini
fi
ln -sf /usr/local/vufind/local/httpd-vufind.conf /etc/apache2/conf-enabled/vufind.conf
chown -R www-data:www-data /usr/local/vufind/local/cache /usr/local/vufind/local/config
exec "$@"