feat: add support for PHP preloading
This commit is contained in:
parent
7ab611a755
commit
0167334910
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
|
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
|
||||||
ARG PHP_VERSION=7.4
|
ARG PHP_VERSION=7.4
|
||||||
ARG NGINX_VERSION=1.17
|
ARG NGINX_VERSION=1.19
|
||||||
|
|
||||||
# "php" stage
|
# "php" stage
|
||||||
FROM php:${PHP_VERSION}-fpm-alpine AS symfony_php
|
FROM php:${PHP_VERSION}-fpm-alpine AS symfony_php
|
||||||
@ -20,7 +20,7 @@ RUN apk add --no-cache \
|
|||||||
jq \
|
jq \
|
||||||
;
|
;
|
||||||
|
|
||||||
ARG APCU_VERSION=5.1.18
|
ARG APCU_VERSION=5.1.19
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
apk add --no-cache --virtual .build-deps \
|
apk add --no-cache --virtual .build-deps \
|
||||||
$PHPIZE_DEPS \
|
$PHPIZE_DEPS \
|
||||||
@ -56,7 +56,7 @@ RUN set -eux; \
|
|||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
|
RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
|
||||||
COPY docker/php/conf.d/symfony.ini $PHP_INI_DIR/conf.d/symfony.ini
|
COPY docker/php/conf.d/symfony.prod.ini $PHP_INI_DIR/conf.d/symfony.ini
|
||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
{ \
|
{ \
|
||||||
|
@ -17,11 +17,9 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
# Comment out the next line in production
|
# Comment out the next line in production
|
||||||
- ./:/srv/app:rw,cached
|
- ./:/srv/app:rw,cached
|
||||||
|
- ./docker/php/conf.d/symfony.dev.ini:/usr/local/etc/php/conf.d/symfony.ini
|
||||||
# If you develop on Linux, comment out the following volumes to just use bind-mounted project directory from host
|
# If you develop on Linux, comment out the following volumes to just use bind-mounted project directory from host
|
||||||
- /srv/app/var/
|
# - ./api/var:/srv/app/var:rw
|
||||||
- /srv/app/var/cache/
|
|
||||||
- /srv/app/var/logs/
|
|
||||||
- /srv/app/var/sessions/
|
|
||||||
environment:
|
environment:
|
||||||
- SYMFONY_VERSION
|
- SYMFONY_VERSION
|
||||||
|
|
||||||
|
14
docker/php/conf.d/symfony.prod.ini
Normal file
14
docker/php/conf.d/symfony.prod.ini
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
apc.enable_cli = 1
|
||||||
|
date.timezone = UTC
|
||||||
|
session.auto_start = Off
|
||||||
|
short_open_tag = Off
|
||||||
|
|
||||||
|
# https://symfony.com/doc/current/performance.html
|
||||||
|
opcache.interned_strings_buffer = 16
|
||||||
|
opcache.max_accelerated_files = 20000
|
||||||
|
opcache.memory_consumption = 256
|
||||||
|
opcache.validate_timestamps = 0
|
||||||
|
realpath_cache_size = 4096K
|
||||||
|
realpath_cache_ttl = 600
|
||||||
|
opcache.preload_user=www-data
|
||||||
|
opcache.preload=/srv/app/var/cache/prod/App_KernelProdContainer.preload.php
|
Loading…
x
Reference in New Issue
Block a user