copy public/ to volume

master
chris 2023-08-10 16:47:22 +02:00
parent f7db2ef12f
commit acfee084c6
2 changed files with 6 additions and 8 deletions

View File

@ -53,8 +53,9 @@ COPY --from=builder /usr/local/etc/php/conf.d /usr/local/etc/php/conf.d
RUN set -xe;\ RUN set -xe;\
apt-get update &&\ apt-get update &&\
apt-get upgrade -y &&\
apt-get install --no-install-recommends -y libzip4 libpq5 libmagickwand-6.q16-6 libxpm4 libwebp6 &&\ apt-get install --no-install-recommends -y libzip4 libpq5 libmagickwand-6.q16-6 libxpm4 libwebp6 &&\
apt-get install --no-install-recommends -y optipng pngquant jpegoptim gifsicle ffmpeg locales gosu dumb-init &&\ apt-get install --no-install-recommends -y optipng pngquant jpegoptim gifsicle ffmpeg locales gosu dumb-init rsync &&\
apt-get clean all &&\ apt-get clean all &&\
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
@ -65,7 +66,7 @@ RUN set -xe;\
sed -i 's/^upload_max_filesize.*/upload_max_filesize = 100M/g' "$PHP_INI_DIR"/php.ini* &&\ sed -i 's/^upload_max_filesize.*/upload_max_filesize = 100M/g' "$PHP_INI_DIR"/php.ini* &&\
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
WORKDIR /var/www WORKDIR /var/www
VOLUME /var/www/storage /var/www/bootstrap VOLUME /var/www/storage /var/www/bootstrap /public
ENTRYPOINT /entrypoint.sh ENTRYPOINT /entrypoint.sh
LABEL build.date=$DATE LABEL build.date=$DATE

View File

@ -1,11 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -xeo pipefail set -xeo pipefail
if [ ! -z $FORCE_HTTPS ]
then
sed -i 's#</VirtualHost#SetEnv HTTPS on\n</VirtualHost#' /etc/apache2/sites-enabled/000-default.conf
fi
cp -r storage.skel/* storage/ cp -r storage.skel/* storage/
chown -R www-data:www-data storage/ bootstrap/ chown -R www-data:www-data storage/ bootstrap/
@ -27,11 +22,13 @@ gosu www-data php artisan cache:clear
gosu www-data php artisan route:cache gosu www-data php artisan route:cache
gosu www-data php artisan view:cache gosu www-data php artisan view:cache
rsync --archive --delete public/ /public/
echo "++++ Check for needed migrations... ++++" echo "++++ Check for needed migrations... ++++"
# check for migrations # check for migrations
gosu www-data php artisan migrate:status | grep No && migrations=yes || migrations=no gosu www-data php artisan migrate:status | grep No && migrations=yes || migrations=no
gosu www-data php artisan migrate:status | grep Pending && migrations=yes || migrations=no gosu www-data php artisan migrate:status | grep Pending && migrations=yes || migrations=no
if [ $migrations = "yes" ]; if [ "$migrations" = "yes" ];
then then
gosu www-data php artisan migrate --force gosu www-data php artisan migrate --force
fi fi