Progress
This commit is contained in:
1 parent
6ebb259757
commit
085ab7e9b8
6 files changed
+96
-8
No files matched your search
+45
-3
@@ -1,6 +1,12 @@
|
||||
FROM php:8.4-fpm-alpine
|
||||
|
||||
# Application root (same default as the apache image)
|
||||
ENV APP_ROOT="/var/www/html"
|
||||
|
||||
ENV TZ="Europe/Prague" \
|
||||
ENABLE_CRON=0 \
|
||||
ENABLE_SUPERVISOR=0 \
|
||||
COMPOSER_ALLOW_SUPERUSER=1 \
|
||||
PHP_OPCACHE_ENABLE=1 \
|
||||
PHP_OPCACHE_VALIDATE_TIMESTAMPS=0 \
|
||||
PHP_OPCACHE_REVALIDATE_FREQ=0 \
|
||||
@@ -25,7 +31,17 @@ RUN apk add --no-cache \
|
||||
libpng \
|
||||
icu \
|
||||
oniguruma \
|
||||
libxml2
|
||||
libxml2 \
|
||||
libwebp \
|
||||
git \
|
||||
nano \
|
||||
zip \
|
||||
unzip \
|
||||
nodejs \
|
||||
npm \
|
||||
supervisor \
|
||||
mysql-client \
|
||||
postgresql-client
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps \
|
||||
$PHPIZE_DEPS \
|
||||
@@ -33,13 +49,14 @@ RUN apk add --no-cache --virtual .build-deps \
|
||||
libzip-dev \
|
||||
freetype-dev \
|
||||
libjpeg-turbo-dev \
|
||||
libwebp-dev \
|
||||
libpng-dev \
|
||||
icu-dev \
|
||||
libxml2-dev \
|
||||
linux-headers
|
||||
|
||||
RUN docker-php-ext-configure \
|
||||
gd --with-freetype --with-jpeg \
|
||||
gd --with-freetype --with-jpeg --with-webp \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
pdo_mysql \
|
||||
pdo_pgsql \
|
||||
@@ -59,6 +76,13 @@ RUN pecl install imagick \
|
||||
|
||||
RUN apk del .build-deps
|
||||
|
||||
# Fail fast if the JPEG delegate did not make it into the image
|
||||
RUN php -r 'if (!in_array("JPEG", Imagick::queryFormats())) { fwrite(STDERR, "ERROR: imagick built without JPEG delegate\n"); exit(1); } echo "imagick JPEG delegate OK\n";' && \
|
||||
php -r 'if (!function_exists("imagecreatefromjpeg")) { fwrite(STDERR, "ERROR: gd built without JPEG support\n"); exit(1); } echo "gd JPEG OK\n";'
|
||||
|
||||
# Composer
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
|
||||
|
||||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
|
||||
&& echo "date.timezone=${TZ}" > "$PHP_INI_DIR/conf.d/99-timezone.ini"
|
||||
|
||||
@@ -81,4 +105,22 @@ RUN { \
|
||||
echo "opcache.max_accelerated_files=${PHP_OPCACHE_MAX_ACCELERATED_FILES}"; \
|
||||
echo "opcache.max_wasted_percentage=${PHP_OPCACHE_MAX_WASTED_PERCENTAGE}"; \
|
||||
echo "opcache.save_comments=1"; \
|
||||
} > "$PHP_INI_DIR/conf.d/10-opcache.ini"
|
||||
} > "$PHP_INI_DIR/conf.d/10-opcache.ini"
|
||||
|
||||
# Supervisor (queue workers, started when ENABLE_SUPERVISOR=1)
|
||||
RUN mkdir -p /var/log/supervisor
|
||||
COPY ./supervisor/supervisord.conf /etc/supervisor/supervisord.conf
|
||||
COPY ./supervisor/conf.d/laravel-queues.conf /etc/supervisor/conf.d/laravel-queues.conf
|
||||
|
||||
# Cron (Laravel scheduler, started when ENABLE_CRON=1)
|
||||
RUN mkdir -p /var/log/cron && \
|
||||
echo "* * * * * cd ${APP_ROOT} && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1" > /etc/crontabs/www-data
|
||||
|
||||
# Entrypoint
|
||||
COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
WORKDIR ${APP_ROOT}
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["php-fpm"]
|
||||
Reference in new issue
Block a user