mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2025-12-31 19:47:25 +01:00
Merge pull request #784 from benbrummer/debian
HEALTHCHECK, mariadb-client and PHP 8.4
This commit is contained in:
7
debian/Dockerfile
vendored
7
debian/Dockerfile
vendored
@@ -1,4 +1,4 @@
|
||||
ARG PHP=8.3
|
||||
ARG PHP=8.4
|
||||
|
||||
FROM php:${PHP}-fpm AS prepare-app
|
||||
|
||||
@@ -23,6 +23,7 @@ ARG php_extra="opcache"
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libfcgi-bin \
|
||||
mariadb-client \
|
||||
gpg \
|
||||
supervisor \
|
||||
@@ -78,8 +79,8 @@ COPY --from=prepare-app /tmp/public /tmp/public
|
||||
COPY --chmod=0755 scripts/init.sh /usr/local/bin/init.sh
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD pgrep -f "php-fpm: master process"
|
||||
HEALTHCHECK --start-period=10s \
|
||||
CMD REMOTE_ADDR=127.0.0.1 REQUEST_URI=/health REQUEST_METHOD=GET SCRIPT_FILENAME=/var/www/html/public/index.php cgi-fcgi -bind -connect 127.0.0.1:9000 | grep '{"status":"ok","message":"API is healthy"}'
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/init.sh"]
|
||||
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||
|
||||
4
debian/scripts/init.sh
vendored
4
debian/scripts/init.sh
vendored
@@ -38,6 +38,10 @@ if [ "$*" = 'supervisord -c /etc/supervisor/supervisord.conf' ]; then
|
||||
/var/www/html/storage \
|
||||
-type d -exec chmod 755 {} \;
|
||||
|
||||
# Fix mariadb-client connection to mysql
|
||||
echo "[client]\nskip-ssl = true" > /var/www/.my.cnf
|
||||
chown www-data:www-data /var/www/.my.cnf
|
||||
|
||||
# Clear and cache config in production
|
||||
if [ "$APP_ENV" = "production" ]; then
|
||||
runuser -u www-data -- php artisan optimize
|
||||
|
||||
Reference in New Issue
Block a user