Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion .github/workflows/docker-image-php84-nginx-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
Expand Down Expand Up @@ -33,4 +34,56 @@ 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
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/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

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
27 changes: 27 additions & 0 deletions .github/workflows/docker-image-php84-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
16 changes: 8 additions & 8 deletions php84-nginx-azure/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,6 +14,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
Expand All @@ -25,7 +25,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 \
Expand All @@ -49,16 +49,16 @@ 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

#Start supervisor
RUN /init_container.sh

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
64 changes: 64 additions & 0 deletions php84-nginx-azure/ast/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
FROM php:8.4-fpm

LABEL maintainer="Johan van der Heide <info@jield.nl>"
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"]
36 changes: 36 additions & 0 deletions php84-worker/ast/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM php:8.4-cli

LABEL maintainer="Johan van der Heide <info@jield.nl>"
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" ]