Updated gitea workflows, php fpm configurations and init scripts
Build and Push Alpine Image / Build and push image (root-user) (push) Successful in 1m7s Details
Build and Push Alpine Image / Build and push image (rootless) (push) Successful in 1m20s Details
Build and Push Ubuntu Image / Build and push image (root) (push) Successful in 1m29s Details
Build and Push Ubuntu Image / Build and push image (rootless) (push) Failing after 30s Details

This commit is contained in:
Aditya Prima 2024-09-12 02:29:42 +07:00
parent 8c22c8d74b
commit 63b72f02d0
11 changed files with 75 additions and 12 deletions

View File

@ -25,6 +25,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=5.6 PHP_VERSION=5.6
ALPINE_VERSION=3.5 ALPINE_VERSION=3.5
push: true push: true
@ -36,6 +37,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.2 PHP_VERSION=7.2
ALPINE_VERSION=3.9 ALPINE_VERSION=3.9
push: true push: true
@ -47,6 +49,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.3 PHP_VERSION=7.3
ALPINE_VERSION=3.10 ALPINE_VERSION=3.10
push: true push: true
@ -58,6 +61,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.4 PHP_VERSION=7.4
ALPINE_VERSION=3.13 ALPINE_VERSION=3.13
push: true push: true
@ -69,6 +73,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.0 PHP_VERSION=8.0
ALPINE_VERSION=3.16 ALPINE_VERSION=3.16
push: true push: true
@ -80,6 +85,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.1 PHP_VERSION=8.1
ALPINE_VERSION=3.18 ALPINE_VERSION=3.18
push: true push: true
@ -91,6 +97,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.2 PHP_VERSION=8.2
ALPINE_VERSION=3.18 ALPINE_VERSION=3.18
push: true push: true
@ -102,6 +109,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine file: Dockerfile.alpine
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.3 PHP_VERSION=8.3
ALPINE_VERSION=3.19 ALPINE_VERSION=3.19
push: true push: true
@ -129,6 +137,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=5.6 PHP_VERSION=5.6
ALPINE_VERSION=3.5 ALPINE_VERSION=3.5
push: true push: true
@ -140,6 +149,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.2 PHP_VERSION=7.2
ALPINE_VERSION=3.9 ALPINE_VERSION=3.9
push: true push: true
@ -151,6 +161,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.3 PHP_VERSION=7.3
ALPINE_VERSION=3.10 ALPINE_VERSION=3.10
push: true push: true
@ -162,6 +173,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.4 PHP_VERSION=7.4
ALPINE_VERSION=3.13 ALPINE_VERSION=3.13
push: true push: true
@ -173,6 +185,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.0 PHP_VERSION=8.0
ALPINE_VERSION=3.16 ALPINE_VERSION=3.16
push: true push: true
@ -184,6 +197,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.1 PHP_VERSION=8.1
ALPINE_VERSION=3.18 ALPINE_VERSION=3.18
push: true push: true
@ -195,6 +209,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.2 PHP_VERSION=8.2
ALPINE_VERSION=3.18 ALPINE_VERSION=3.18
push: true push: true
@ -206,6 +221,7 @@ jobs:
context: . context: .
file: Dockerfile.alpine-rootless file: Dockerfile.alpine-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.3 PHP_VERSION=8.3
ALPINE_VERSION=3.19 ALPINE_VERSION=3.19
push: true push: true

View File

@ -25,6 +25,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=5.6 PHP_VERSION=5.6
push: true push: true
tags: | tags: |
@ -36,6 +37,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.2 PHP_VERSION=7.2
push: true push: true
tags: | tags: |
@ -47,6 +49,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.3 PHP_VERSION=7.3
push: true push: true
tags: | tags: |
@ -58,6 +61,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.4 PHP_VERSION=7.4
push: true push: true
tags: | tags: |
@ -69,6 +73,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.0 PHP_VERSION=8.0
push: true push: true
tags: | tags: |
@ -80,6 +85,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.1 PHP_VERSION=8.1
push: true push: true
tags: | tags: |
@ -91,6 +97,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.2 PHP_VERSION=8.2
push: true push: true
tags: | tags: |
@ -102,6 +109,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu file: Dockerfile.ubuntu
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.3 PHP_VERSION=8.3
push: true push: true
tags: | tags: |
@ -130,6 +138,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=5.6 PHP_VERSION=5.6
push: true push: true
tags: | tags: |
@ -141,6 +150,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.2 PHP_VERSION=7.2
push: true push: true
tags: | tags: |
@ -152,6 +162,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.3 PHP_VERSION=7.3
push: true push: true
tags: | tags: |
@ -163,6 +174,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=7.4 PHP_VERSION=7.4
push: true push: true
tags: | tags: |
@ -174,6 +186,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.0 PHP_VERSION=8.0
push: true push: true
tags: | tags: |
@ -185,6 +198,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.1 PHP_VERSION=8.1
push: true push: true
tags: | tags: |
@ -196,6 +210,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.2 PHP_VERSION=8.2
push: true push: true
tags: | tags: |
@ -207,6 +222,7 @@ jobs:
context: . context: .
file: Dockerfile.ubuntu-rootless file: Dockerfile.ubuntu-rootless
build-args: | build-args: |
REGISTRY_URL=docker.io/aprimediet
PHP_VERSION=8.3 PHP_VERSION=8.3
push: true push: true
tags: | tags: |

View File

@ -32,4 +32,6 @@ RUN chmod +x /usr/local/bin/php-fpm-healthcheck
# CLEAN APK CACHES # CLEAN APK CACHES
RUN rm -vrf /var/cache/apk/* RUN rm -vrf /var/cache/apk/*
EXPOSE 9000 EXPOSE 9000
CMD ["sh","-c", "/usr/local/bin/php-fpm-init"]

View File

@ -12,6 +12,9 @@ RUN addgroup -g 10001 phpfpm && adduser -D -u 10001 -G phpfpm -s /bin/sh -h /app
# Set workdir # Set workdir
WORKDIR / WORKDIR /
# CREATE FUTURE WORKDIR
RUN mkdir -p /app && chown phpfpm:phpfpm /app
# INSTALL PHP APP # INSTALL PHP APP
RUN --mount=type=cache,target=/var/cache/apk \ RUN --mount=type=cache,target=/var/cache/apk \
apk upgrade && apk add --update \ apk upgrade && apk add --update \
@ -26,7 +29,7 @@ ADD ./etc/php/fpm/php-fpm.conf /etc/php/fpm/php-fpm.conf
ADD ./etc/php/fpm/pool.d-rootless /etc/php/fpm/pool.d ADD ./etc/php/fpm/pool.d-rootless /etc/php/fpm/pool.d
# COPY INIT SCRIPT # COPY INIT SCRIPT
ADD ./scripts/php-fpm-init-alpine /usr/local/bin/php-fpm-init ADD ./scripts/php-fpm-init-alpine-rootless /usr/local/bin/php-fpm-init
RUN chmod +x /usr/local/bin/php-fpm-init RUN chmod +x /usr/local/bin/php-fpm-init
# INSTALL PHP FPM HEALTHCHECK UTILITIES # INSTALL PHP FPM HEALTHCHECK UTILITIES
@ -36,6 +39,11 @@ RUN chmod +x /usr/local/bin/php-fpm-healthcheck
# CLEAN APK CACHES # CLEAN APK CACHES
RUN rm -vrf /var/cache/apk/* RUN rm -vrf /var/cache/apk/*
# SET USER WORKDIR
WORKDIR /app
USER phpfpm USER phpfpm
EXPOSE 9000 EXPOSE 9000
CMD ["sh","-c", "/usr/local/bin/php-fpm-init"]

View File

@ -31,4 +31,6 @@ RUN chmod +x /usr/local/bin/php-fpm-healthcheck
# CLEAN APT CACHE # CLEAN APT CACHE
RUN apt -y clean RUN apt -y clean
EXPOSE 9000 EXPOSE 9000
CMD ["sh","-c", "/usr/local/bin/php-fpm-init"]

View File

@ -12,6 +12,9 @@ RUN groupadd -g 10001 phpfpm && useradd -D -u 10001 -G phpfpm -s /bin/sh -h /app
# Set workdir # Set workdir
WORKDIR / WORKDIR /
# CREATE FUTURE WORKDIR
RUN mkdir -p /app && chown phpfpm:phpfpm /app
# INSTALL BASE DEPENDENCIES # INSTALL BASE DEPENDENCIES
RUN --mount=type=cache,target=/var/cache/apt/archives \ RUN --mount=type=cache,target=/var/cache/apt/archives \
apt -y update && apt -y upgrade && apt -y install \ apt -y update && apt -y upgrade && apt -y install \
@ -34,6 +37,11 @@ RUN chmod +x /usr/local/bin/php-fpm-healthcheck
# CLEAN APT CACHE # CLEAN APT CACHE
RUN apt -y clean RUN apt -y clean
# SET USER WORKDIR
WORKDIR /app
USER phpfpm USER phpfpm
EXPOSE 9000 EXPOSE 9000
CMD ["sh","-c", "/usr/local/bin/php-fpm-init"]

View File

@ -3,6 +3,7 @@
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
;pid = /run/php/php5.6-fpm.pid ;pid = /run/php/php5.6-fpm.pid
pid = /tmp/php-fpm.pid
error_log = /proc/self/fd/2 error_log = /proc/self/fd/2
log_level = warning log_level = warning
emergency_restart_threshold = 10 emergency_restart_threshold = 10

View File

@ -20,7 +20,7 @@ listen.group = phpfpm
;rlimit_files = 1024 ;rlimit_files = 1024
;rlimit_core = 0 ;rlimit_core = 0
;chroot = ;chroot =
;chdir = /var/www chdir = /app
;catch_workers_output = yes ;catch_workers_output = yes
clear_env = no clear_env = no
;security.limit_extensions = .php .php3 .php4 .php5 ;security.limit_extensions = .php .php3 .php4 .php5
@ -37,9 +37,9 @@ pm.min_spare_servers = 5
pm.max_spare_servers = 5 pm.max_spare_servers = 5
pm.process_idle_timeout = 10s; pm.process_idle_timeout = 10s;
pm.max_requests = 500 pm.max_requests = 500
;pm.status_path = /status pm.status_path = /php-status
;ping.path = /ping ping.path = /php-ping
;ping.response = pong ping.response = pong
; ;
; PHP.INI OVERRIDE ; PHP.INI OVERRIDE

View File

@ -37,9 +37,9 @@ pm.min_spare_servers = 5
pm.max_spare_servers = 5 pm.max_spare_servers = 5
pm.process_idle_timeout = 10s; pm.process_idle_timeout = 10s;
pm.max_requests = 500 pm.max_requests = 500
;pm.status_path = /status pm.status_path = /php-status
;ping.path = /ping ping.path = /php-ping
;ping.response = pong ping.response = pong
; ;
; PHP.INI OVERRIDE ; PHP.INI OVERRIDE

View File

@ -0,0 +1,5 @@
#!/bin/sh
echo "--------------------"
echo "Starting PHP FPM ${PHP_VERSION}"
echo "--------------------"
$PHP_FPM_BIN -F -O -c /etc/php${PHP_VERSION} -y /etc/php/fpm/php-fpm.conf

View File

@ -0,0 +1,5 @@
#!/bin/sh
echo "--------------------"
echo "Starting PHP FPM ${PHP_VERSION}"
echo "--------------------"
$PHP_FPM_BIN -F -O -c /etc/php/${PHP_VERSION}/cli -y /etc/php/fpm/php-fpm.conf