diff --git a/Dockerfile b/Dockerfile index a61755f..de571ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN set -xe;\ FROM reg.zknt.org/zknt/debian-php COPY --from=builder /var/www /var/www COPY entrypoint.sh /entrypoint.sh +COPY wait-for-db.php /wait-for-db.php RUN apt-install php-curl php-zip php-bcmath php-intl php-mbstring php-xml optipng pngquant jpegoptim gifsicle ffmpeg php-imagick php-gd php-redis php-mysql &&\ a2enmod rewrite &&\ sed -i 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf diff --git a/entrypoint.sh b/entrypoint.sh index ae84305..6827d82 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,8 @@ set -xeo pipefail cp -r storage.skel/* storage/ +php /wait-for-db.php + if [[ ! -e storage/.docker.init ]]; then echo "Fresh installation, initializing database..." diff --git a/wait-for-db.php b/wait-for-db.php new file mode 100644 index 0000000..aec9ce2 --- /dev/null +++ b/wait-for-db.php @@ -0,0 +1,31 @@ +