diff --git a/Dockerfile b/Dockerfile index c583d42..e20088b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,9 @@ ## base FROM ghcr.io/eramba/php:8.1-apache as base +# Install rsync +RUN apt-get update && apt-get install -y rsync + # Setup vhost COPY ./docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 35aa60c..a47a852 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,9 +1,10 @@ #!/bin/sh -# chown www-data: -R /var/www - cd /var/www/eramba || exit +# syncing dir structure into /data folder from /data_template +su -s /bin/bash -c "rsync -rv app/upgrade/data_template/ app/upgrade/data/" www-data + # when deploying a code or DB migration change and you want the "old workers" based on the old code # to not process any new incoming jobs after deployment. su -s /bin/bash -c "php app/upgrade/bin/cake.php queue worker end all -q" www-data @@ -20,6 +21,6 @@ su -s /bin/bash -c "php app/upgrade/bin/cake.php database initialize" www-data su -s /bin/bash -c "php app/upgrade/bin/cake.php setup.maintenance_mode deactivate" www-data # Initialize a worker with the deployment so we won't have to wait for the cron to kick in which can take up to 10 minutes. -su -s /bin/bash -c "php app/upgrade/bin/cake.php queue run -v" www-data 2>&1 & +su -s /bin/bash -c "php app/upgrade/bin/cake.php queue run -v" www-data 2>&1 & exec docker-php-entrypoint "$@"