From 5150401c8b14eedd207b8c10182a7faa5ded2460 Mon Sep 17 00:00:00 2001 From: Johan van der Heide Date: Mon, 7 Apr 2025 22:42:18 +0200 Subject: [PATCH 1/5] Version bumps --- php84-nginx-azure/Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/php84-nginx-azure/Dockerfile b/php84-nginx-azure/Dockerfile index 4f6f1b6..1395e2c 100644 --- a/php84-nginx-azure/Dockerfile +++ b/php84-nginx-azure/Dockerfile @@ -15,6 +15,7 @@ RUN echo 'max_execution_time = 300' >> /usr/local/etc/php/conf.d/docker-php-max- RUN echo 'opcache.max_accelerated_files = 20000' >> /usr/local/etc/php/conf.d/docker-php-opcache.ini; RUN echo 'opcache.validate_timestamps=0' >> /usr/local/etc/php/conf.d/docker-php-opcache.ini; RUN echo 'realpath_cache_ttl=600' >> /usr/local/etc/php/conf.d/docker-php-realpatch-cache.ini; +RUN echo 'expose_php=off' >> /usr/local/etc/php/conf.d/docker-php-expose.ini; COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer @@ -25,7 +26,7 @@ WORKDIR /var/www RUN install-php-extensions gd redis xsl apcu igbinary intl gmp gettext zip opcache soap bcmath pdo_mysql RUN apt-get update && \ -apt-get install -y --no-install-recommends \ + apt-get install -y --no-install-recommends \ supervisor \ openssh-server \ redis-server \ @@ -49,11 +50,11 @@ RUN chmod +x /init_container.sh \ COPY .docker/ssh/sshd_config /etc/ssh/sshd_config COPY .docker/scripts/ssh_setup.sh /tmp/ssh_setup.sh RUN mkdir -p /opt/startup \ - && chmod -R +x /opt/startup \ - && chmod -R +x /init_container.sh \ - && chmod -R +x /tmp/ssh_setup.sh \ - && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ - && rm -rf /tmp/* + && chmod -R +x /opt/startup \ + && chmod -R +x /init_container.sh \ + && chmod -R +x /tmp/ssh_setup.sh \ + && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ + && rm -rf /tmp/* # Open port 2222 for SSH access EXPOSE 80 2222 @@ -61,4 +62,4 @@ EXPOSE 80 2222 #Start supervisor RUN /init_container.sh -CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] \ No newline at end of file +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] From 9f4dc59b34533c757e151561891acabf9d1f629e Mon Sep 17 00:00:00 2001 From: Johan van der Heide Date: Mon, 7 Apr 2025 22:59:41 +0200 Subject: [PATCH 2/5] Version bumps --- .../docker-image-php84-nginx-azure.yml | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image-php84-nginx-azure.yml b/.github/workflows/docker-image-php84-nginx-azure.yml index 997d965..bb794c0 100644 --- a/.github/workflows/docker-image-php84-nginx-azure.yml +++ b/.github/workflows/docker-image-php84-nginx-azure.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - develop pull_request: branches: - main @@ -33,4 +34,30 @@ jobs: file: ./php84-nginx-azure/Dockerfile #Use this format so we have access to the scripts folder platforms: linux/amd64 push: true - tags: ghcr.io/jield-webdev/docker-repos/php8.4-nginx-azure:latest \ No newline at end of file + tags: ghcr.io/jield-webdev/docker-repos/php8.4-nginx-azure:latest + + build-arm64: + runs-on: ubuntu-24.04-arm + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + + - name: Build and push linux/arm64 + uses: docker/build-push-action@v6 + with: + context: . + file: ./php84-nginx-azure/Dockerfile #Use this format so we have access to the scripts folder + platforms: linux/arm64 + push: true + tags: ghcr.io/jield-webdev/docker-repos/php8.4-nginx-azure:arm64 \ No newline at end of file From d1efa51cae08a43c1dae86d5ceec0ce858770134 Mon Sep 17 00:00:00 2001 From: Johan van der Heide Date: Sun, 13 Apr 2025 13:39:09 +0200 Subject: [PATCH 3/5] Version bumps --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2b899d5..692e284 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ PHP versions: - 8.1.32 (only Azure container) - 8.2.28 -- 8.3.19 -- 8.4.5 +- 8.3.20 +- 8.4.6 Azure containers contain an SSH server and default Azure credentials. Johan van der Heide, Jield BV (johan.vanderheide@jield.nl) From bcaa0e0a7a18a4ff1d448b1c8b9587ef04db06ce Mon Sep 17 00:00:00 2001 From: Johan van der Heide Date: Sun, 13 Apr 2025 20:34:23 +0200 Subject: [PATCH 4/5] Version bumps --- .../docker-image-php84-nginx-azure.yml | 26 ++++++++ php84-nginx-azure/AST.Dockerfile | 64 +++++++++++++++++++ php84-nginx-azure/Dockerfile | 1 - 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 php84-nginx-azure/AST.Dockerfile diff --git a/.github/workflows/docker-image-php84-nginx-azure.yml b/.github/workflows/docker-image-php84-nginx-azure.yml index bb794c0..08427d9 100644 --- a/.github/workflows/docker-image-php84-nginx-azure.yml +++ b/.github/workflows/docker-image-php84-nginx-azure.yml @@ -36,6 +36,32 @@ jobs: push: true tags: ghcr.io/jield-webdev/docker-repos/php8.4-nginx-azure:latest + build-ast-time: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + file: ./php84-nginx-azure/Dockerfile #Use this format so we have access to the scripts folder + platforms: linux/amd64 + push: true + tags: ghcr.io/jield-webdev/docker-repos/php8.4-nginx-azure:ast-time + build-arm64: runs-on: ubuntu-24.04-arm diff --git a/php84-nginx-azure/AST.Dockerfile b/php84-nginx-azure/AST.Dockerfile new file mode 100644 index 0000000..4ccd4f9 --- /dev/null +++ b/php84-nginx-azure/AST.Dockerfile @@ -0,0 +1,64 @@ +FROM php:8.4-fpm + +LABEL maintainer="Johan van der Heide " +LABEL org.opencontainers.image.source="https://github.com/jield-webdev/docker-repos" +LABEL org.opencontainers.image.description="PHP 8.4 Nginx production Docker container (for Azure)" + +ENV TZ="America/Glace_Bay" +RUN echo 'date.timezone=America/Glace_Bay' >> /usr/local/etc/php/conf.d/docker-php-timezone.ini; +RUN echo 'memory_limit = 2G' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini; +RUN echo 'max_input_vars = 10000' >> /usr/local/etc/php/conf.d/docker-php-maxinputvars.ini; +RUN echo 'upload_max_filesize = 32M' >> /usr/local/etc/php/conf.d/docker-php-limits.ini; +RUN echo 'post_max_size = 32M' >> /usr/local/etc/php/conf.d/docker-php-limits.ini; +RUN echo 'max_execution_time = 300' >> /usr/local/etc/php/conf.d/docker-php-max-execution.ini; +RUN echo 'opcache.max_accelerated_files = 20000' >> /usr/local/etc/php/conf.d/docker-php-opcache.ini; +RUN echo 'opcache.validate_timestamps=0' >> /usr/local/etc/php/conf.d/docker-php-opcache.ini; +RUN echo 'realpath_cache_ttl=600' >> /usr/local/etc/php/conf.d/docker-php-realpatch-cache.ini; +RUN echo 'expose_php=off' >> /usr/local/etc/php/conf.d/docker-php-expose.ini; + +COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Set working directory +WORKDIR /var/www + +RUN install-php-extensions gd redis xsl apcu igbinary intl gmp gettext zip opcache soap bcmath pdo_mysql + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + supervisor \ + openssh-server \ + redis-server \ + nginx-full \ + zip + +# Copy and configure the ssh_setup file +RUN mkdir -p /tmp + +#Copy the nginx conf +COPY .docker/nginx/nginx.conf /etc/nginx/sites-enabled/default +COPY .docker/supervisor/supervisord.nginx.conf /etc/supervisor/conf.d/supervisord.conf +COPY .docker/scripts/init_container_php84.sh /init_container.sh + +RUN chmod +x /init_container.sh \ + && mkdir -p /home/LogFiles/ \ + && echo "root:Docker!" | chpasswd \ + && mkdir -p /opt/startup + +# configure startup +COPY .docker/ssh/sshd_config /etc/ssh/sshd_config +COPY .docker/scripts/ssh_setup.sh /tmp/ssh_setup.sh +RUN mkdir -p /opt/startup \ + && chmod -R +x /opt/startup \ + && chmod -R +x /init_container.sh \ + && chmod -R +x /tmp/ssh_setup.sh \ + && (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \ + && rm -rf /tmp/* + +# Open port 2222 for SSH access +EXPOSE 80 2222 + +#Start supervisor +RUN /init_container.sh + +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] diff --git a/php84-nginx-azure/Dockerfile b/php84-nginx-azure/Dockerfile index 1395e2c..569d304 100644 --- a/php84-nginx-azure/Dockerfile +++ b/php84-nginx-azure/Dockerfile @@ -5,7 +5,6 @@ LABEL org.opencontainers.image.source="https://github.com/jield-webdev/docker-re LABEL org.opencontainers.image.description="PHP 8.4 Nginx production Docker container (for Azure)" ENV TZ="Europe/Amsterdam" - RUN echo 'date.timezone=Europe/Amsterdam' >> /usr/local/etc/php/conf.d/docker-php-timezone.ini; RUN echo 'memory_limit = 2G' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini; RUN echo 'max_input_vars = 10000' >> /usr/local/etc/php/conf.d/docker-php-maxinputvars.ini; From 28efb406479f333cc1e7fdbb8b15f787439b418f Mon Sep 17 00:00:00 2001 From: Johan van der Heide Date: Sun, 13 Apr 2025 20:41:52 +0200 Subject: [PATCH 5/5] Support for AST Time --- .../docker-image-php84-nginx-azure.yml | 2 +- .../workflows/docker-image-php84-worker.yml | 27 ++++++++++++++ .../{AST.Dockerfile => ast/Dockerfile} | 0 php84-worker/ast/Dockerfile | 36 +++++++++++++++++++ 4 files changed, 64 insertions(+), 1 deletion(-) rename php84-nginx-azure/{AST.Dockerfile => ast/Dockerfile} (100%) create mode 100644 php84-worker/ast/Dockerfile diff --git a/.github/workflows/docker-image-php84-nginx-azure.yml b/.github/workflows/docker-image-php84-nginx-azure.yml index 08427d9..0da3bad 100644 --- a/.github/workflows/docker-image-php84-nginx-azure.yml +++ b/.github/workflows/docker-image-php84-nginx-azure.yml @@ -57,7 +57,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: ./php84-nginx-azure/Dockerfile #Use this format so we have access to the scripts folder + file: ./php84-nginx-azure/ast/Dockerfile #Use this format so we have access to the scripts folder platforms: linux/amd64 push: true tags: ghcr.io/jield-webdev/docker-repos/php8.4-nginx-azure:ast-time diff --git a/.github/workflows/docker-image-php84-worker.yml b/.github/workflows/docker-image-php84-worker.yml index 4b9d996..e46b4c7 100644 --- a/.github/workflows/docker-image-php84-worker.yml +++ b/.github/workflows/docker-image-php84-worker.yml @@ -35,6 +35,33 @@ jobs: push: true tags: ghcr.io/jield-webdev/docker-repos/php8.4-worker:latest + build-ast-time: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + + - name: Build and push (amd64) + uses: docker/build-push-action@v6 + with: + context: . + file: ./php84-worker/ast/Dockerfile # Use this format so we have access to the scripts folder + platforms: linux/amd64 + push: true + tags: ghcr.io/jield-webdev/docker-repos/php8.4-worker:ast-time + + build-arm64: runs-on: ubuntu-24.04-arm diff --git a/php84-nginx-azure/AST.Dockerfile b/php84-nginx-azure/ast/Dockerfile similarity index 100% rename from php84-nginx-azure/AST.Dockerfile rename to php84-nginx-azure/ast/Dockerfile diff --git a/php84-worker/ast/Dockerfile b/php84-worker/ast/Dockerfile new file mode 100644 index 0000000..f81ecd4 --- /dev/null +++ b/php84-worker/ast/Dockerfile @@ -0,0 +1,36 @@ +FROM php:8.4-cli + +LABEL maintainer="Johan van der Heide " +LABEL org.opencontainers.image.source="https://github.com/jield-webdev/docker-repos" +LABEL org.opencontainers.image.description="PHP 8.4 CLI production Docker worker container" + +ENV TZ="America/Glace_Bay" + +COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +RUN install-php-extensions gd redis xsl apcu igbinary intl gmp gettext zip opcache soap bcmath pdo_mysql + +RUN echo 'date.timezone=America/Glace_Bay' >> /usr/local/etc/php/conf.d/docker-php-timezone.ini; + +## Install cron, redis and supervisor +RUN apt-get update && apt-get install -y cron redis-server supervisor nano zip unzip + +# Set working directory +WORKDIR /var/www + +# Copy crontab file to the cron.d directory +COPY .docker/crontab/crontab.sample /etc/cron.d/cronjobs + +# Copy entrypoint file to the etc +COPY .docker/scripts/entrypoint_cron.sh /etc/entrypoint.sh +COPY .docker/supervisor/supervisord.cron.conf /etc/supervisor/conf.d/supervisord.conf + +# Give correct rights to the cron job +RUN chmod 0644 /etc/cron.d/cronjobs + +# Give execution rights to the entrypoint +RUN chmod +x /etc/entrypoint.sh + +# Run the command on container startup +ENTRYPOINT [ "/etc/entrypoint.sh" ] \ No newline at end of file