Merge pull request #300 from lwj5/docker-helm

Updated Dockerfile and supervisord.conf
This commit is contained in:
David Bomba
2021-03-24 11:58:56 +11:00
committed by GitHub
7 changed files with 26 additions and 22 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,8 +71,9 @@ 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 /
COPY ./config/supervisor/* /
## Separate user
ARG UID=1500
@@ -87,7 +87,8 @@ RUN addgroup --gid=$UID -S "$INVOICENINJA_USER" \
--ingroup "$INVOICENINJA_USER" \
--no-create-home \
"$INVOICENINJA_USER" \
&& addgroup "$INVOICENINJA_USER" www-data \
&& chmod +x /usr/local/bin/docker-entrypoint \
&& chmod +x /shutdown.sh \
&& 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,8 +0,0 @@
#!/bin/bash
printf "READY\n";
while read line; do
echo "Processing Event: $line" >&2;
kill -SIGQUIT $PPID
done < /dev/stdin

View File

@@ -0,0 +1,8 @@
#!/bin/sh
printf "READY\n"
while read line; do
echo "Processing Event: $line" >&2
kill -SIGQUIT $PPID
done </dev/stdin

View File

@@ -3,11 +3,9 @@ nodaemon=true
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
@@ -16,7 +14,6 @@ stderr_logfile_maxbytes=0
command=php-fpm
[program:scheduler]
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
@@ -27,7 +24,6 @@ command=php artisan schedule:work
[program:queue-worker]
process_name=%(program_name)s_%(process_num)02d
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
@@ -44,4 +40,3 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

View File

@@ -82,8 +82,10 @@ 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
# Set permission for web server to create/update files (only <v4)
if [[ ${str::1} -le 4 ]]; then
chown -R "$INVOICENINJA_USER":www-data /var/www/app/storage /var/www/app/public /var/www/app/bootstrap
fi
# Initialize values that might be stored in a file
file_env 'APP_KEY'
@@ -104,6 +106,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 "$@"

1
env
View File

@@ -3,6 +3,7 @@ APP_KEY=<insert your generated key in here>
APP_DEBUG=true
MULTI_DB_ENABLED=false
DB_HOST1=db
DB_PORT1=3306
DB_USERNAME1=ninja
DB_PASSWORD1=ninja
DB_DATABASE1=ninja