From e09efcec35ea1b8e611d06607272dc14ad2d4cd7 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Thu, 25 Jan 2024 09:01:38 +0000 Subject: [PATCH] add php-fpm 8.3 build and nginx unit php 8.2 build to CI --- .github/workflows/ci-build-php.yml | 30 +++++++++++++ config/php/Dockerfile.8.1 | 4 +- config/php/Dockerfile.8.2 | 4 +- config/php/Dockerfile.8.3 | 45 +++++++++++++++++++ .../{Dockerfile.unit => Dockerfile.unit.8.2} | 1 - config/php/nginx-unit.json | 1 - docker-compose.yml | 2 +- 7 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 config/php/Dockerfile.8.3 rename config/php/{Dockerfile.unit => Dockerfile.unit.8.2} (99%) diff --git a/.github/workflows/ci-build-php.yml b/.github/workflows/ci-build-php.yml index 3ddc615..f4d17c4 100644 --- a/.github/workflows/ci-build-php.yml +++ b/.github/workflows/ci-build-php.yml @@ -54,3 +54,33 @@ jobs: --platform linux/amd64,linux/arm/v7,linux/arm64 \ -f Dockerfile.8.2 \ -t ghcr.io/paskal/bitrix-php:8.2 -t paskal/bitrix-php:8.2 . + + - name: build PHP 8.3 image for ghcr.io and DockerHub + working-directory: config/php + if: ${{ github.ref == 'refs/heads/master' }} + env: + GITHUB_PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} + USERNAME: ${{ github.actor }} + run: | + echo ${GITHUB_PACKAGE_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin + echo ${DOCKER_HUB_TOKEN} | docker login -u paskal --password-stdin + docker buildx build --push \ + --platform linux/amd64,linux/arm/v7,linux/arm64 \ + -f Dockerfile.8.3 \ + -t ghcr.io/paskal/bitrix-php:8.3 -t paskal/bitrix-php:8.3 . + + - name: build Nginx Unit PHP 8.2 image for ghcr.io and DockerHub + working-directory: config/php + if: ${{ github.ref == 'refs/heads/master' }} + env: + GITHUB_PACKAGE_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }} + USERNAME: ${{ github.actor }} + run: | + echo ${GITHUB_PACKAGE_TOKEN} | docker login ghcr.io -u ${USERNAME} --password-stdin + echo ${DOCKER_HUB_TOKEN} | docker login -u paskal --password-stdin + docker buildx build --push \ + --platform linux/amd64,linux/arm/v7,linux/arm64 \ + -f Dockerfile.unit.8.2 \ + -t ghcr.io/paskal/nginx-unit-bitrix:8.2 -t paskal/nginx-unit-bitrix:8.2 . diff --git a/config/php/Dockerfile.8.1 b/config/php/Dockerfile.8.1 index 79da335..589fe54 100644 --- a/config/php/Dockerfile.8.1 +++ b/config/php/Dockerfile.8.1 @@ -28,14 +28,14 @@ RUN apt-get update \ msmtp-mta \ sudo \ cron \ - && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* # msmtp to allow email sending # msmtp-mta to allow sendmail usage with msmtp # sudo to allow create logfile with www-data user # cron to run cronjobs in a separate container -# without this, php container won't work if you forget to mount 90-php.ini +# without this, php in the container won't work if you forget to mount 90-php.ini COPY ./90-php.ini /etc/php/8.1/fpm/conf.d/90-php.ini COPY ./90-php.ini /etc/php/8.1/cli/conf.d/90-php.ini # disable xdebug by default as it affects performance badly diff --git a/config/php/Dockerfile.8.2 b/config/php/Dockerfile.8.2 index c3f100d..cd4aeff 100644 --- a/config/php/Dockerfile.8.2 +++ b/config/php/Dockerfile.8.2 @@ -28,14 +28,14 @@ RUN apt-get update \ msmtp-mta \ sudo \ cron \ - && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* # msmtp to allow email sending # msmtp-mta to allow sendmail usage with msmtp # sudo to allow create logfile with www-data user # cron to run cronjobs in a separate container -# without this, php container won't work if you forget to mount 90-php.ini +# without this, php in the container won't work if you forget to mount 90-php.ini COPY ./90-php.ini /etc/php/8.2/fpm/conf.d/90-php.ini COPY ./90-php.ini /etc/php/8.2/cli/conf.d/90-php.ini # disable xdebug by default as it affects performance badly diff --git a/config/php/Dockerfile.8.3 b/config/php/Dockerfile.8.3 new file mode 100644 index 0000000..4a185b3 --- /dev/null +++ b/config/php/Dockerfile.8.3 @@ -0,0 +1,45 @@ +FROM phpdockerio/php:8.3-fpm +# https://github.com/bitrixdock/bitrixdock/blob/master/php/php83/Dockerfile + +LABEL org.opencontainers.image.authors="Dmitry Verkhoturov " \ + org.opencontainers.image.description="PHP-fpm 8.3 with everything needed for Bitrix" \ + org.opencontainers.image.documentation="https://github.com/paskal/bitrix.infra" \ + org.opencontainers.image.source="https://github.com/paskal/bitrix.infra.git" \ + org.opencontainers.image.title="php" + +RUN apt-get update \ + && apt-get -y --no-install-recommends install \ + php8.3-gd \ + php8.3-imagick \ + php8.3-interbase \ + php8.3-intl \ + php8.3-mbstring \ + php8.3-mcrypt \ + php8.3-memcache \ + php8.3-memcached \ + php8.3-mysql \ + php8.3-opcache \ + php8.3-soap \ + php8.3-zip \ + webp \ + msmtp \ + msmtp-mta \ + sudo \ + cron \ + && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + +# msmtp to allow email sending +# msmtp-mta to allow sendmail usage with msmtp +# sudo to allow create logfile with www-data user +# cron to run cronjobs in a separate container + +# without this, php in the container won't work if you forget to mount 90-php.ini +COPY ./90-php.ini /etc/php/8.3/fpm/conf.d/90-php.ini +COPY ./90-php.ini /etc/php/8.3/cli/conf.d/90-php.ini +# disable xdebug by default as it affects performance badly +COPY ./xdebug.ini /etc/php/8.3/mods-available/xdebug.ini + +RUN usermod -u 1000 www-data +RUN groupmod -g 1000 www-data + +EXPOSE 9000 diff --git a/config/php/Dockerfile.unit b/config/php/Dockerfile.unit.8.2 similarity index 99% rename from config/php/Dockerfile.unit rename to config/php/Dockerfile.unit.8.2 index b9bb375..201a3db 100644 --- a/config/php/Dockerfile.unit +++ b/config/php/Dockerfile.unit.8.2 @@ -50,4 +50,3 @@ COPY nginx-unit.json /docker-entrypoint.d/.unit.conf.json EXPOSE 8090 8091 8092 8093 CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"] - diff --git a/config/php/nginx-unit.json b/config/php/nginx-unit.json index 96e7560..433e303 100644 --- a/config/php/nginx-unit.json +++ b/config/php/nginx-unit.json @@ -99,4 +99,3 @@ }, "access_log": "/var/log/php/unit-access.log" } - diff --git a/docker-compose.yml b/docker-compose.yml index 43a98b8..41aafc2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,7 +84,7 @@ services: dockerfile: Dockerfile.unit hostname: nginx-unit container_name: nginx-unit - image: paskal/nginx-unit:8.2-bitrix + image: paskal/nginx-unit-bitrix:8.2 restart: always depends_on: - memcached