From 4b2cff18b2f0a1c489918571d2de77c365523b3e Mon Sep 17 00:00:00 2001 From: James Carlo Luchavez Date: Wed, 29 May 2024 21:38:39 +0800 Subject: [PATCH] "Addition of PHP 8.3" - Set the PHP_VERSION at .env from 8.1 to 8.3. - Added "8.3" on the pv array at Daily-checklist.yaml. - Added a step to build php8.3 at docker-image.yml. - Created Dockerfile-8.3. - Added "8.3" to the PHP version options at settings.yml. --- .env | 4 +- .github/workflows/Daily-checklist.yaml | 14 +++--- .github/workflows/docker-image.yml | 16 ++++--- .gitignore | 3 +- Dockerfile-8.3 | 60 ++++++++++++++++++++++++++ settings.yml | 9 ++-- 6 files changed, 87 insertions(+), 19 deletions(-) create mode 100644 Dockerfile-8.3 diff --git a/.env b/.env index 34f8a40..aead0eb 100644 --- a/.env +++ b/.env @@ -2,10 +2,10 @@ SERVER_ROOT=/var/www/ APP_CODE_PATH_HOST=/tmp APP_CODE_CONTAINER_FLAG=:cached APP_CODE_PATH_NGINX=/var/www -PHP_VERSION=8.1 +PHP_VERSION=8.3 NGINX_HOST_HTTP_PORT=5647 DISPLAY_PHPERROR=true XDEBUG=flase INSTALL_ADDITIONAL_EXTENSIONS= USER_ID=1000 -GROUP_ID=1000 \ No newline at end of file +GROUP_ID=1000 diff --git a/.github/workflows/Daily-checklist.yaml b/.github/workflows/Daily-checklist.yaml index 9e6fdc6..874ee64 100644 --- a/.github/workflows/Daily-checklist.yaml +++ b/.github/workflows/Daily-checklist.yaml @@ -12,7 +12,7 @@ jobs: Nginx-AMD64: strategy: matrix: - pv: ["8.2", "8.1", "8.0", "7.4", "7.2"] + pv: ["8.3", "8.2", "8.1", "8.0", "7.4", "7.2"] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -58,7 +58,7 @@ jobs: status: ${{ job.status }} notification_title: "{emoji} *{job}* has {status_message}" message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" - footer: "Linked Repo <{repo_url}|{repo}>" + footer: "Linked Repo <{repo_url}|{repo}>" mention_users: "D056LFW47NF," mention_users_when: "SUCCESS" mention_groups: "C06H0SB11JL" @@ -82,7 +82,7 @@ jobs: Nginx-ARM64: strategy: matrix: - pv: ["8.2", "8.1", "8.0", "7.4", "7.2"] + pv: ["8.3", "8.2", "8.1", "8.0", "7.4", "7.2"] runs-on: ubuntu-22.04 name: Nginx-ARM64 steps: @@ -141,7 +141,7 @@ jobs: status: ${{ job.status }} notification_title: "{emoji} *{job}* has {status_message}" message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" - footer: "Linked Repo <{repo_url}|{repo}>" + footer: "Linked Repo <{repo_url}|{repo}>" mention_users: "D056LFW47NF," mention_users_when: "SUCCESS" mention_groups: "C06H0SB11JL" @@ -162,7 +162,7 @@ jobs: mention_groups_when: "failure,warnings" env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }} - + Nginx75-AMD64: strategy: matrix: @@ -210,7 +210,7 @@ jobs: status: ${{ job.status }} notification_title: "{emoji} *{job}* has {status_message}" message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" - footer: "Linked Repo <{repo_url}|{repo}>" + footer: "Linked Repo <{repo_url}|{repo}>" mention_users: "D056LFW47NF," mention_users_when: "SUCCESS" mention_groups: "C06H0SB11JL" @@ -291,7 +291,7 @@ jobs: status: ${{ job.status }} notification_title: "{emoji} *{job}* has {status_message}" message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}" - footer: "Linked Repo <{repo_url}|{repo}>" + footer: "Linked Repo <{repo_url}|{repo}>" mention_users: "D056LFW47NF," mention_users_when: "SUCCESS" mention_groups: "C06H0SB11JL" diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a83e429..412b424 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -20,14 +20,14 @@ jobs: PHP_VERSION: "5.6" XDEBUG: true DISPLAY_PHPERROR: true - + - name: Build the Docker image with php7.1 run: docker-compose build env: PHP_VERSION: "7.1" XDEBUG: true DISPLAY_PHPERROR: true - + - name: Build the Docker image with php7.2 run: docker-compose build env: @@ -48,17 +48,23 @@ jobs: PHP_VERSION: "8.0" XDEBUG: true DISPLAY_PHPERROR: true - + - name: Build the Docker image with php8.1 run: docker-compose build env: PHP_VERSION: "8.1" XDEBUG: true DISPLAY_PHPERROR: true - + - name: Build the Docker image with php8.2 run: docker-compose build env: PHP_VERSION: "8.2" XDEBUG: true - DISPLAY_PHPERROR: true \ No newline at end of file + DISPLAY_PHPERROR: true + - name: Build the Docker image with php8.3 + run: docker-compose build + env: + PHP_VERSION: "8.3" + XDEBUG: true + DISPLAY_PHPERROR: true diff --git a/.gitignore b/.gitignore index 9186015..da75c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .DS_Store -data \ No newline at end of file +data +.idea diff --git a/Dockerfile-8.3 b/Dockerfile-8.3 new file mode 100644 index 0000000..6f62cf5 --- /dev/null +++ b/Dockerfile-8.3 @@ -0,0 +1,60 @@ +FROM ghcr.io/deck-app/nginx:v8.3 +LABEL maintainer Naba Das + +# Persistent runtime dependencies +# Example RUN apk add --no-cache php83-openssl php83-sysvmsg php83-curl + +COPY default.conf /etc/nginx/conf.d/default.conf +ARG SERVER_ROOT +RUN sed -i "s#{SERVER_ROOT}#${SERVER_ROOT}#g" /etc/nginx/conf.d/default.conf +VOLUME [ "/var/www/" ] +WORKDIR /var/www + +#PHP display error enable or disable +ENV PHP_VERSION=83 +ADD package.sh /package.sh +COPY php_ini/php.ini /etc/php${PHP_VERSION}/php.ini +ARG DISPLAY_PHPERROR +RUN if [ ${DISPLAY_PHPERROR} = true ]; then \ +sed -i "s#{DISPLAY}#On#g" /etc/php${PHP_VERSION}/php.ini \ +;else \ +sed -i "s#{DISPLAY}#Off#g" /etc/php${PHP_VERSION}/php.ini \ +;fi + +## Linux permission issue +ARG USER_ID +ARG GROUP_ID +RUN apk --no-cache add shadow sudo php${PHP_VERSION}-pecl-mongodb +RUN usermod -u ${USER_ID} nobody && groupmod -g ${GROUP_ID} nobody + +# sudo command without password +RUN echo "nobody ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + +#Xdebug enable or disable +ARG XDEBUG +RUN if [ ${XDEBUG} = true ]; then \ +apk add php${PHP_VERSION}-pecl-xdebug \ +&& echo "zend_extension=xdebug" >> /etc/php${PHP_VERSION}/php.ini \ +;fi + +## nobody permission issue +COPY www.conf /etc/php${PHP_VERSION}/php-fpm.d/www.conf +COPY nginx.conf /etc/nginx/nginx.conf +RUN touch /env +RUN chown -R nobody:nobody /env +RUN chown -R nobody:nobody /sbin/ +RUN chown -R nobody:nobody /etc/php83/ +RUN chown -R nobody:nobody /etc/service/ +RUN chown -R nobody:nobody /var/run/ +RUN chown -R nobody:nobody /var/log/ +RUN chown -R nobody:nobody /var/lib/nginx +RUN chown -R nobody:nobody /etc/nginx + +ARG INSTALL_ADDITIONAL_EXTENSIONS +ENV INSTALL_ADDITIONAL_EXTENSIONS=$INSTALL_ADDITIONAL_EXTENSIONS +RUN if [ -z "$INSTALL_ADDITIONAL_EXTENSIONS" ] ; then \ +echo "No additional PHP extensions added" \ +;else \ +bash /package.sh \ +;fi +USER nobody diff --git a/settings.yml b/settings.yml index 2371c44..ec594fc 100644 --- a/settings.yml +++ b/settings.yml @@ -12,9 +12,10 @@ user: - 7.1 - 7.2 - 7.4 - - "8.0" - - "8.1" - - "8.2" + - 8.0 + - 8.1 + - 8.2 + - 8.3 target: PHP_VERSION @@ -23,7 +24,7 @@ user: Enable PHP error reporting? type: checkbox - hint: Check the box to display PHP errors + hint: Check the box to display PHP errors target: DISPLAY_PHPERROR php_xdebug: