Modified to fit k8s

This commit is contained in:
Lee Ween Jiann
2021-03-23 19:47:11 +08:00
parent f175fa4fb0
commit c0350de418
4 changed files with 15 additions and 15 deletions

View File

@@ -44,9 +44,8 @@ LABEL maintainer="David Bomba <turbo124@gmail.com>"
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

View File

@@ -14,4 +14,4 @@ realpath_cache_ttl = 600
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 8M
upload_max_filesize = 8M

View File

@@ -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

View File

@@ -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 "$@"