diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d1a7af..9c3afa1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,60 +5,45 @@ name: Build PHP docker images on: push: branches: - - master + - master pull_request: branches: - - master + - master schedule: - cron: '0 12 * * SUN' # every sunday workflow_dispatch: jobs: + lint: + name: Lint Dockerfile + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: hadolint/hadolint-action@v3.1.0 + build: name: PHP runs-on: ubuntu-latest continue-on-error: true - strategy: - fail-fast: false - matrix: - php_version: - - '7.4' - - '8.0' - - '8.1' - - '8.2' steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - id: setup-buildx - uses: docker/setup-buildx-action@v2 - with: - platforms: | - linux/amd64 - linux/arm64 + uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 + uses: docker/login-action@v3 with: - images: lephare/php - tags: | - type=raw,${{ matrix.php_version }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/bake-action@v4 with: - context: "{{defaultContext}}:${{ matrix.php_version }}" push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: ${{ steps.setup-buildx.outputs.platforms }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.spells b/.spells new file mode 100644 index 0000000..f0f5e4f --- /dev/null +++ b/.spells @@ -0,0 +1,5 @@ +function hadolint() { + docker run --rm -i -v ./hadolint.yaml:/.config/hadolint.yaml hadolint/hadolint < Dockerfile +} + +echo hadolint diff --git a/7.4/Dockerfile b/7.4/Dockerfile deleted file mode 100644 index ea842c5..0000000 --- a/7.4/Dockerfile +++ /dev/null @@ -1,64 +0,0 @@ -FROM php:7.4-fpm - -ENV XDEBUG_VERSION 3.1.6 - -# Xdebug: remote step debugging port -EXPOSE 9003 - -RUN apt-get update \ - && apt-get full-upgrade -y \ - && apt-get install -y --no-install-recommends \ - locales \ - git \ - ssh \ - unzip \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libmemcached-dev \ - libzip-dev \ - libicu-dev \ - libpq-dev \ - libssh2-1 libssh2-1-dev \ - libxml2-dev \ - libwebp-dev \ - libmagickwand-dev \ - # oniguruma not bundled in php, use libonig: https://www.php.net/manual/en/migration74.other-changes.php - libonig-dev \ - && rm -rf /var/lib/apt/lists/* \ - && dpkg-reconfigure -f noninteractive locales \ - && echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \ - && echo 'fr_FR.UTF-8 UTF-8' >> /etc/locale.gen \ - && locale-gen - -# migrating to pkg-config: https://www.php.net/manual/en/migration74.other-changes.php#migration74.other-changes.pkg-config -RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ - && docker-php-ext-install -j$(nproc) intl gd opcache mbstring zip pdo_pgsql pdo_mysql soap pgsql mysqli exif - -# PECL modules -RUN pecl install imagick && docker-php-ext-enable imagick -RUN pecl install memcached && docker-php-ext-enable memcached -RUN pecl install apcu && docker-php-ext-enable apcu -RUN pecl install ssh2-1.2 && docker-php-ext-enable ssh2 -RUN pecl install xdebug-$XDEBUG_VERSION && docker-php-ext-enable xdebug - -# Install Composer -ENV COMPOSER_ALLOW_SUPERUSER 1 -COPY --from=composer /usr/bin/composer /usr/local/bin/composer - -# Install Blackfire -RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ - && export ARCHITECTURE=$(uname -m) \ - && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/${ARCHITECTURE}/${VERSION} \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ - && mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ - && echo "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > $PHP_INI_DIR/conf.d/blackfire.ini - -RUN usermod -u 1000 www-data -RUN usermod -G staff www-data - -WORKDIR /var/www/symfony - -# Config -COPY symfony.ini $PHP_INI_DIR/conf.d/ -COPY symfony.pool.conf $PHP_INI_DIR/pool.d/ diff --git a/7.4/symfony.ini b/7.4/symfony.ini deleted file mode 100644 index ae6b4dc..0000000 --- a/7.4/symfony.ini +++ /dev/null @@ -1,18 +0,0 @@ -short_open_tag = Off -magic_quotes_gpc = Off -register_globals = Off -session.autostart = Off -date.timezone = Europe/Paris -upload_max_filesize = 32M -post_max_size = 33M -session.save_handler = "memcached" -session.save_path = "memcached:11211" -max_execution_time = 600 -memory_limit = 1024M -memcached.sess_lock_wait_min = 150 -memcached.sess_lock_wait_max = 150 -memcached.sess_lock_retries = 800 -opcache.max_accelerated_files=7963 -opcache.memory_consumption=192 -opcache.interned_strings_buffer=32 -opcache.fast_shutdown=1 diff --git a/8.0/Dockerfile b/8.0/Dockerfile deleted file mode 100644 index a67e2ae..0000000 --- a/8.0/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -FROM php:8.0-fpm - -ARG PICKLE_EXTENSIONS - -RUN apt-get update \ - && apt-get full-upgrade -y \ - && apt-get install -y --no-install-recommends \ - locales \ - git \ - ssh \ - unzip \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libmemcached-dev \ - libzip-dev \ - libicu-dev \ - libpq-dev \ - libssh2-1 libssh2-1-dev \ - libxml2-dev \ - libwebp-dev \ - libmagickwand-dev \ - # oniguruma not bundled in php, use libonig: https://www.php.net/manual/en/migration74.other-changes.php - libonig-dev \ - && rm -rf /var/lib/apt/lists/* \ - && dpkg-reconfigure -f noninteractive locales \ - && echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \ - && echo 'fr_FR.UTF-8 UTF-8' >> /etc/locale.gen \ - && locale-gen - -# migrating to pkg-config: https://www.php.net/manual/en/migration74.other-changes.php#migration74.other-changes.pkg-config -RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ - && docker-php-ext-install -j$(nproc) intl gd opcache mbstring zip pdo_pgsql soap pgsql exif - -# Extra extensions using pickle: https://github.com/docker-library/php/pull/840#issuecomment-502251019 -ADD https://github.com/FriendsOfPHP/pickle/releases/download/v0.7.7/pickle.phar /usr/local/bin/pickle -ENV PICKLE_EXTENSIONS=${PICKLE_EXTENSIONS:-"apcu memcached imagick xdebug"} -RUN chmod +x /usr/local/bin/pickle && \ - ( \ - for extension in $PICKLE_EXTENSIONS; do \ - pickle install -n $extension; \ - docker-php-ext-enable $extension; \ - done \ - ) - -# Install Composer -ENV COMPOSER_ALLOW_SUPERUSER 1 -COPY --from=composer /usr/bin/composer /usr/local/bin/composer - -# # Install Blackfire -RUN export VERSION=`php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;"` \ - && echo https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ - && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/${VERSION} \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ - && mv /tmp/blackfire-*.so `php -r "echo ini_get('extension_dir');"`/blackfire.so \ - && echo -e "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707" > $PHP_INI_DIR/conf.d/blackfire.ini - -RUN usermod -u 1000 www-data -RUN usermod -G staff www-data - -WORKDIR /var/www/symfony - -# Config -COPY symfony.ini $PHP_INI_DIR/conf.d/ -COPY symfony.pool.conf $PHP_INI_DIR/pool.d/ diff --git a/8.0/symfony.ini b/8.0/symfony.ini deleted file mode 100644 index ae6b4dc..0000000 --- a/8.0/symfony.ini +++ /dev/null @@ -1,18 +0,0 @@ -short_open_tag = Off -magic_quotes_gpc = Off -register_globals = Off -session.autostart = Off -date.timezone = Europe/Paris -upload_max_filesize = 32M -post_max_size = 33M -session.save_handler = "memcached" -session.save_path = "memcached:11211" -max_execution_time = 600 -memory_limit = 1024M -memcached.sess_lock_wait_min = 150 -memcached.sess_lock_wait_max = 150 -memcached.sess_lock_retries = 800 -opcache.max_accelerated_files=7963 -opcache.memory_consumption=192 -opcache.interned_strings_buffer=32 -opcache.fast_shutdown=1 diff --git a/8.0/symfony.pool.conf b/8.0/symfony.pool.conf deleted file mode 100644 index 94649b1..0000000 --- a/8.0/symfony.pool.conf +++ /dev/null @@ -1,81 +0,0 @@ -; Start a new pool named 'symfony'. -; the variable $pool can we used in any directive and will be replaced by the -; pool name ('symfony' here) -[symfony] - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = www-data -group = www-data - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a -; specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = 0.0.0.0:9000 - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 20 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -;--------------------- - -; Make specific Docker environment variables available to PHP -env[DB_1_ENV_MYSQL_DATABASE] = $DB_1_ENV_MYSQL_DATABASE -env[DB_1_ENV_MYSQL_USER] = $DB_1_ENV_MYSQL_USER -env[DB_1_ENV_MYSQL_PASSWORD] = $DB_1_ENV_MYSQL_PASSWORD - -catch_workers_output = yes diff --git a/8.1/Dockerfile b/8.1/Dockerfile deleted file mode 100644 index 3b260d6..0000000 --- a/8.1/Dockerfile +++ /dev/null @@ -1,68 +0,0 @@ -FROM php:8.1-fpm - -ARG PICKLE_EXTENSIONS -ENV PICKLE_VERSION v0.7.11 - -RUN apt-get update \ - && apt-get full-upgrade -y \ - && apt-get install -y --no-install-recommends \ - locales \ - git \ - ssh \ - unzip \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libmemcached-dev \ - libzip-dev \ - libicu-dev \ - libpq-dev \ - libssh2-1 libssh2-1-dev \ - libxml2-dev \ - libwebp-dev \ - libmagickwand-dev \ - # oniguruma not bundled in php, use libonig: https://www.php.net/manual/en/migration74.other-changes.php - libonig-dev \ - && rm -rf /var/lib/apt/lists/* \ - && dpkg-reconfigure -f noninteractive locales \ - && echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \ - && echo 'fr_FR.UTF-8 UTF-8' >> /etc/locale.gen \ - && locale-gen - -# migrating to pkg-config: https://www.php.net/manual/en/migration74.other-changes.php#migration74.other-changes.pkg-config -RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ - && docker-php-ext-install -j$(nproc) intl gd opcache mbstring zip pdo_pgsql soap pgsql exif - -# Extra extensions using pickle: https://github.com/docker-library/php/pull/840#issuecomment-502251019 -ADD https://github.com/FriendsOfPHP/pickle/releases/download/${PICKLE_VERSION}/pickle.phar /usr/local/bin/pickle -ENV PICKLE_EXTENSIONS=${PICKLE_EXTENSIONS:-"apcu memcached imagick xdebug"} -RUN chmod +x /usr/local/bin/pickle && \ - ( \ - for extension in $PICKLE_EXTENSIONS; do \ - pickle install -n $extension; \ - docker-php-ext-enable $extension; \ - done \ - ) - -# Install Composer -ENV COMPOSER_ALLOW_SUPERUSER 1 -COPY --from=composer /usr/bin/composer /usr/local/bin/composer - -# Install Blackfire (https://blackfire.io/docs/php/integrations/php-docker) -RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ - && architecture=$(uname -m) \ - && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz - -RUN usermod -u 1000 www-data -RUN usermod -G staff www-data - -WORKDIR /var/www/symfony - -# Config -COPY symfony.ini $PHP_INI_DIR/conf.d/ -COPY symfony.pool.conf $PHP_INI_DIR/pool.d/ diff --git a/8.1/symfony.pool.conf b/8.1/symfony.pool.conf deleted file mode 100644 index 94649b1..0000000 --- a/8.1/symfony.pool.conf +++ /dev/null @@ -1,81 +0,0 @@ -; Start a new pool named 'symfony'. -; the variable $pool can we used in any directive and will be replaced by the -; pool name ('symfony' here) -[symfony] - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = www-data -group = www-data - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a -; specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = 0.0.0.0:9000 - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 20 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -;--------------------- - -; Make specific Docker environment variables available to PHP -env[DB_1_ENV_MYSQL_DATABASE] = $DB_1_ENV_MYSQL_DATABASE -env[DB_1_ENV_MYSQL_USER] = $DB_1_ENV_MYSQL_USER -env[DB_1_ENV_MYSQL_PASSWORD] = $DB_1_ENV_MYSQL_PASSWORD - -catch_workers_output = yes diff --git a/8.2/Dockerfile b/8.2/Dockerfile deleted file mode 100644 index 741339d..0000000 --- a/8.2/Dockerfile +++ /dev/null @@ -1,68 +0,0 @@ -FROM php:8.2-fpm - -ARG PICKLE_EXTENSIONS -ENV PICKLE_VERSION v0.7.11 - -RUN apt-get update \ - && apt-get full-upgrade -y \ - && apt-get install -y --no-install-recommends \ - locales \ - git \ - ssh \ - unzip \ - libfreetype6-dev \ - libjpeg62-turbo-dev \ - libpng-dev \ - libmemcached-dev \ - libzip-dev \ - libicu-dev \ - libpq-dev \ - libssh2-1 libssh2-1-dev \ - libxml2-dev \ - libwebp-dev \ - libmagickwand-dev \ - # oniguruma not bundled in php, use libonig: https://www.php.net/manual/en/migration74.other-changes.php - libonig-dev \ - && rm -rf /var/lib/apt/lists/* \ - && dpkg-reconfigure -f noninteractive locales \ - && echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen \ - && echo 'fr_FR.UTF-8 UTF-8' >> /etc/locale.gen \ - && locale-gen - -# migrating to pkg-config: https://www.php.net/manual/en/migration74.other-changes.php#migration74.other-changes.pkg-config -RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ - && docker-php-ext-install -j$(nproc) intl gd opcache mbstring zip pdo_pgsql soap pgsql exif - -# Extra extensions using pickle: https://github.com/docker-library/php/pull/840#issuecomment-502251019 -ADD https://github.com/FriendsOfPHP/pickle/releases/download/${PICKLE_VERSION}/pickle.phar /usr/local/bin/pickle -ENV PICKLE_EXTENSIONS=${PICKLE_EXTENSIONS:-"apcu memcached imagick xdebug"} -RUN chmod +x /usr/local/bin/pickle && \ - ( \ - for extension in $PICKLE_EXTENSIONS; do \ - pickle install -n $extension; \ - docker-php-ext-enable $extension; \ - done \ - ) - -# Install Composer -ENV COMPOSER_ALLOW_SUPERUSER 1 -COPY --from=composer /usr/bin/composer /usr/local/bin/composer - -# Install Blackfire (https://blackfire.io/docs/php/integrations/php-docker) -RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ - && architecture=$(uname -m) \ - && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \ - && mkdir -p /tmp/blackfire \ - && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ - && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ - && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ - && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz - -RUN usermod -u 1000 www-data -RUN usermod -G staff www-data - -WORKDIR /var/www/symfony - -# Config -COPY symfony.ini $PHP_INI_DIR/conf.d/ -COPY symfony.pool.conf $PHP_INI_DIR/pool.d/ diff --git a/8.2/symfony.ini b/8.2/symfony.ini deleted file mode 100644 index ae6b4dc..0000000 --- a/8.2/symfony.ini +++ /dev/null @@ -1,18 +0,0 @@ -short_open_tag = Off -magic_quotes_gpc = Off -register_globals = Off -session.autostart = Off -date.timezone = Europe/Paris -upload_max_filesize = 32M -post_max_size = 33M -session.save_handler = "memcached" -session.save_path = "memcached:11211" -max_execution_time = 600 -memory_limit = 1024M -memcached.sess_lock_wait_min = 150 -memcached.sess_lock_wait_max = 150 -memcached.sess_lock_retries = 800 -opcache.max_accelerated_files=7963 -opcache.memory_consumption=192 -opcache.interned_strings_buffer=32 -opcache.fast_shutdown=1 diff --git a/8.2/symfony.pool.conf b/8.2/symfony.pool.conf deleted file mode 100644 index 94649b1..0000000 --- a/8.2/symfony.pool.conf +++ /dev/null @@ -1,81 +0,0 @@ -; Start a new pool named 'symfony'. -; the variable $pool can we used in any directive and will be replaced by the -; pool name ('symfony' here) -[symfony] - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = www-data -group = www-data - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses on a -; specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = 0.0.0.0:9000 - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 20 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -;--------------------- - -; Make specific Docker environment variables available to PHP -env[DB_1_ENV_MYSQL_DATABASE] = $DB_1_ENV_MYSQL_DATABASE -env[DB_1_ENV_MYSQL_USER] = $DB_1_ENV_MYSQL_USER -env[DB_1_ENV_MYSQL_PASSWORD] = $DB_1_ENV_MYSQL_PASSWORD - -catch_workers_output = yes diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7843898 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +ARG PHP_VERSION + +FROM mlocati/php-extension-installer:2 as extension-installer +FROM php:${PHP_VERSION}-fpm as base +FROM base +ARG PHP_EXTENSIONS + +WORKDIR /usr/local/etc/php +COPY --link symfony.ini ./conf.d/ +COPY --link symfony.pool.conf ./pool.d/ + +COPY --from=extension-installer /usr/bin/install-php-extensions /usr/local/bin + +RUN install-php-extensions ${PHP_EXTENSIONS} + +RUN usermod -u 1000 www-data && usermod -G staff www-data + +WORKDIR /var/www/symfony diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..fb9a9bf --- /dev/null +++ b/compose.yaml @@ -0,0 +1,44 @@ +services: + php_74: + image: lephare/php:7.4 + build: + args: &build-args + PHP_VERSION: "7.4" + PHP_EXTENSIONS: "@composer apcu exif gd imagick intl memcached opcache pdo_pgsql pgsql soap xdebug zip" + x-bake: &build-x-bake + platforms: + - linux/amd64 + - linux/arm64 + + php_80: + image: lephare/php:8.0 + build: + args: + <<: *build-args + PHP_VERSION: "8.0" + x-bake: *build-x-bake + + php_81: + image: lephare/php:8.1 + build: + args: + <<: *build-args + PHP_VERSION: "8.1" + x-bake: *build-x-bake + + php_82: + image: lephare/php:8.2 + build: + args: + <<: *build-args + PHP_VERSION: "8.2" + x-bake: *build-x-bake + + php_83: + image: lephare/php:8.3 + build: + args: + <<: *build-args + PHP_VERSION: "8.3" + PHP_EXTENSIONS: "@composer apcu exif gd intl memcached opcache pdo_pgsql pgsql soap xdebug zip" # Disable Imagick for PHP 8.3 until https://github.com/Imagick/imagick/issues/640 is fixed + x-bake: *build-x-bake diff --git a/hadolint.yaml b/hadolint.yaml new file mode 100644 index 0000000..e277c53 --- /dev/null +++ b/hadolint.yaml @@ -0,0 +1 @@ +failure-threshold: style diff --git a/8.1/symfony.ini b/symfony.ini similarity index 96% rename from 8.1/symfony.ini rename to symfony.ini index ae6b4dc..4e219ef 100644 --- a/8.1/symfony.ini +++ b/symfony.ini @@ -16,3 +16,4 @@ opcache.max_accelerated_files=7963 opcache.memory_consumption=192 opcache.interned_strings_buffer=32 opcache.fast_shutdown=1 +xdebug.mode=off diff --git a/7.4/symfony.pool.conf b/symfony.pool.conf similarity index 100% rename from 7.4/symfony.pool.conf rename to symfony.pool.conf