diff --git a/alpine/Dockerfile_v5 b/alpine/Dockerfile_v5 index b513a4b..9c9f704 100644 --- a/alpine/Dockerfile_v5 +++ b/alpine/Dockerfile_v5 @@ -44,9 +44,8 @@ LABEL maintainer="David Bomba " WORKDIR /var/www/app COPY --from=frontend /var/www/app /var/www/app -COPY entrypoint.sh /usr/local/bin/docker-entrypoint -RUN chmod +x /usr/local/bin/docker-entrypoint \ - && mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini + +RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini # Install PHP extensions # https://hub.docker.com/r/mlocati/php-extension-installer/tags @@ -72,6 +71,7 @@ RUN set -eux; \ chromium \ ttf-freefont +COPY entrypoint.sh /usr/local/bin/docker-entrypoint COPY ./config/php/php.ini /usr/local/etc/php/conf.d/in-php.ini COPY ./config/supervisor/supervisord.conf / @@ -87,10 +87,10 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \ --ingroup "$INVOICENINJA_USER" \ --no-create-home \ "$INVOICENINJA_USER" \ - && addgroup "$INVOICENINJA_USER" www-data \ - && mkdir /var/log/supervisord /var/run/supervisord \ - && chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app \ - && chown $INVOICENINJA_USER:www-data /var/log/supervisord /var/run/supervisord + && chmod +x /usr/local/bin/docker-entrypoint \ + && mkdir /app /var/log/supervisord \ + && chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /app \ + && chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app USER $UID diff --git a/config/php/php.ini b/config/php/php.ini index e614f65..1ecaf93 100644 --- a/config/php/php.ini +++ b/config/php/php.ini @@ -14,4 +14,4 @@ realpath_cache_ttl = 600 ; Maximum allowed size for uploaded files. ; http://php.net/upload-max-filesize -upload_max_filesize = 8M \ No newline at end of file +upload_max_filesize = 8M diff --git a/config/supervisor/supervisord.conf b/config/supervisor/supervisord.conf index 80c968b..efeb566 100644 --- a/config/supervisor/supervisord.conf +++ b/config/supervisor/supervisord.conf @@ -1,14 +1,12 @@ [supervisord] nodaemon=true user=invoiceninja -pidfile=/var/run/supervisord/supervisord.pid +pidfile=/tmp/supervisord.pid logfile=/dev/null ; nodaemon will cause logs to go to stdout logfile_maxbytes=0 -loglevel=error +loglevel=info [program:php-fpm] -autostart=true -autorestart=true redirect_stderr=true stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 diff --git a/entrypoint.sh b/entrypoint.sh index 9967f20..d32b35d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -82,9 +82,6 @@ elif [ -d "$BAK_PUBLIC_PATH/logo" ]; then fi rm -rf "$BAK_PUBLIC_PATH" -# Set permission for web server to create/update files -chown -R "$INVOICENINJA_USER":www-data /var/www/app/storage /var/www/app/public /var/www/app/bootstrap - # Initialize values that might be stored in a file file_env 'APP_KEY' file_env 'API_SECRET' @@ -104,6 +101,11 @@ file_env 'S3_SECRET' # Run Laravel stuff php artisan config:cache php artisan optimize + +while ! mysqladmin ping -h "$DB_HOST1" -P $DB_PORT1 --silent; do + echo "Waiting for DB ($DB_HOST1:$DB_PORT1)" + sleep 1 +done php artisan migrate --force exec docker-php-entrypoint "$@"