Skip to content

Commit 0167334

Browse files
committed
feat: add support for PHP preloading
1 parent 7ab611a commit 0167334

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
77
ARG PHP_VERSION=7.4
8-
ARG NGINX_VERSION=1.17
8+
ARG NGINX_VERSION=1.19
99

1010
# "php" stage
1111
FROM php:${PHP_VERSION}-fpm-alpine AS symfony_php
@@ -20,7 +20,7 @@ RUN apk add --no-cache \
2020
jq \
2121
;
2222

23-
ARG APCU_VERSION=5.1.18
23+
ARG APCU_VERSION=5.1.19
2424
RUN set -eux; \
2525
apk add --no-cache --virtual .build-deps \
2626
$PHPIZE_DEPS \
@@ -56,7 +56,7 @@ RUN set -eux; \
5656
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
5757

5858
RUN ln -s $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini
59-
COPY docker/php/conf.d/symfony.ini $PHP_INI_DIR/conf.d/symfony.ini
59+
COPY docker/php/conf.d/symfony.prod.ini $PHP_INI_DIR/conf.d/symfony.ini
6060

6161
RUN set -eux; \
6262
{ \

docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ services:
1717
volumes:
1818
# Comment out the next line in production
1919
- ./:/srv/app:rw,cached
20+
- ./docker/php/conf.d/symfony.dev.ini:/usr/local/etc/php/conf.d/symfony.ini
2021
# If you develop on Linux, comment out the following volumes to just use bind-mounted project directory from host
21-
- /srv/app/var/
22-
- /srv/app/var/cache/
23-
- /srv/app/var/logs/
24-
- /srv/app/var/sessions/
22+
# - ./api/var:/srv/app/var:rw
2523
environment:
2624
- SYMFONY_VERSION
2725

File renamed without changes.

docker/php/conf.d/symfony.prod.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apc.enable_cli = 1
2+
date.timezone = UTC
3+
session.auto_start = Off
4+
short_open_tag = Off
5+
6+
# https://symfony.com/doc/current/performance.html
7+
opcache.interned_strings_buffer = 16
8+
opcache.max_accelerated_files = 20000
9+
opcache.memory_consumption = 256
10+
opcache.validate_timestamps = 0
11+
realpath_cache_size = 4096K
12+
realpath_cache_ttl = 600
13+
opcache.preload_user=www-data
14+
opcache.preload=/srv/app/var/cache/prod/App_KernelProdContainer.preload.php

0 commit comments

Comments
 (0)