From 63a8203c884429ebc5e04ed743be973ed58227f9 Mon Sep 17 00:00:00 2001 From: Tom Harper Date: Fri, 22 Nov 2024 15:54:58 +0000 Subject: [PATCH] add php 8.4 dockerfile (#26) --- .github/workflows/build.yml | 1 + php-84/DockerFile | 59 +++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 php-84/DockerFile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c16f369..3764246 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: - php-81 - php-82 - php-83 + - php-84 - node-6 - node-8 - node-10 diff --git a/php-84/DockerFile b/php-84/DockerFile new file mode 100644 index 0000000..6c42e89 --- /dev/null +++ b/php-84/DockerFile @@ -0,0 +1,59 @@ +############################################################ +# Dockerfile to create a php container to run the project +############################################################ + +FROM php:8.4-fpm +COPY --from=php:8.4-cli /usr/local/bin/phpdbg /usr/local/bin/ + +# Set working directory +WORKDIR /var/www + +# NVM Settings +ENV NVM_DIR /usr/local/nvm +ENV NVM_VERSION v0.39.3 + +# Copy all config +COPY /resources/config/php/ /docker-config/ + +# Only copy install scripts +COPY /resources/scripts/php/install_* /docker-scripts/ + +# Run Installation Scripts +RUN /docker-scripts/install_dependencies.sh sudo vim nano netcat-traditional git iputils-ping dnsutils default-mysql-client imagemagick jq +RUN install-php-extensions mysqli \ + pdo_mysql \ + mbstring \ + exif \ + pcntl \ + soap \ + gd \ + zip \ + sockets \ + opcache \ + intl \ + redis \ + imagick/imagick@master \ + yaml +RUN /docker-scripts/install_users.sh +RUN /docker-scripts/install_config.sh +RUN /docker-scripts/install_nvm.sh + +# Copy Entrypoint & Start Scripts etc. +# If these change we don't want to rerun the above layers, hence do this last. +COPY /resources/scripts/php/entrypoint.sh /docker-scripts/entrypoint.sh +COPY /resources/scripts/php/root-start-script.sh /docker-scripts/root-start-script.sh +COPY /resources/scripts/php/www-start-script.sh /docker-scripts/www-start-script.sh +COPY /resources/scripts/php/qa-start-script.sh /docker-scripts/qa-start-script.sh + +# Copy the script to run the scheduler +COPY /resources/scripts/php/run-scheduler.sh /run-scheduler.sh + +ENTRYPOINT [ "/docker-scripts/entrypoint.sh" ] + +# Change to WWW user +USER www + +# Expose port 9000 and start php-fpm server +EXPOSE 9000 + +CMD ["php-fpm"]