diff --git a/Dockerfile b/Dockerfile index f31a142..a3c185c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -80,12 +80,14 @@ VOLUME /etc/ssl/groupoffice COPY ./etc/php.ini $PHP_INI_DIR #configure apache -ADD ./etc/apache2/sites-available/000-default.conf $APACHE_CONFDIR/sites-available/000-default.conf +COPY ./etc/apache2/sites-available/000-default.conf $APACHE_CONFDIR/sites-available/000-default.conf -RUN mkdir -p /etc/groupoffice/multi_instance && chown -R www-data:www-data /etc/groupoffice #default group-office config -ADD ./etc/groupoffice/docker-config.php.tpl /usr/local/share/groupoffice-docker-config.php.tpl -ADD ./etc/groupoffice/config.php /etc/groupoffice/config.php +COPY ./etc/groupoffice/docker-config.php.tpl /usr/local/share/groupoffice-docker-config.php.tpl +COPY ./etc/groupoffice/config.php /usr/local/share/groupoffice-config.php + +RUN mkdir -p /etc/groupoffice/multi_instance && chown -R www-data:www-data /etc/groupoffice +RUN cp -a /usr/local/share/groupoffice-config.php /etc/groupoffice/config.php #For persistant configuration VOLUME /etc/groupoffice diff --git a/docker-go-entrypoint.sh b/docker-go-entrypoint.sh index 445bf8d..9b14208 100755 --- a/docker-go-entrypoint.sh +++ b/docker-go-entrypoint.sh @@ -1,6 +1,18 @@ #!/bin/sh set -e +if [ ! -d /etc/groupoffice/multi_instance ]; then + mkdir -p /etc/groupoffice/multi_instance && chown -R www-data:www-data /etc/groupoffice +fi + +if [ ! -d /var/lib/groupoffice/multi_instance ]; then + mkdir -p /var/lib/groupoffice/multi_instance && chown -R www-data:www-data /var/lib/groupoffice +fi + +if [ ! -f /etc/groupoffice/config.php ]; then + cp /usr/local/share/groupoffice-config.php /etc/groupoffice/config.php +fi + cp /usr/local/share/groupoffice-docker-config.php.tpl /etc/groupoffice/docker-config.php sed -i 's/{dbHost}/'${MYSQL_HOST}'/' /etc/groupoffice/docker-config.php @@ -8,6 +20,5 @@ sed -i 's/{dbName}/'${MYSQL_DATABASE}'/' /etc/groupoffice/docker-config.php sed -i 's/{dbUser}/'${MYSQL_USER}'/' /etc/groupoffice/docker-config.php sed -i 's/{dbPass}/'${MYSQL_PASSWORD}'/' /etc/groupoffice/docker-config.php - #call original entry point docker-php-entrypoint "$@"