Added rootless images
Build and Push Alpine Image / Build and push image (root-user) (push) Successful in 1m6s Details
Build and Push Alpine Image / Build and push image (rootless) (push) Successful in 2m1s Details
Build and Push Ubuntu Image / Build and push image (rootless) (push) Has been cancelled Details
Build and Push Ubuntu Image / Build and push image (root) (push) Has been cancelled Details

This commit is contained in:
Aditya Prima 2024-09-12 00:42:37 +07:00
parent 49c7b14aba
commit 7c87ba597e
9 changed files with 789 additions and 3 deletions

View File

@ -0,0 +1,215 @@
name: Build and Push Alpine Image
on:
push:
branches:
- master
jobs:
build:
name: Build and push image (root-user)
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Winter Access Git Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: aprimediet
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push 5.6 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=5.6
ALPINE_VERSION=3.5
push: true
tags: |
aprimediet/php-fpm:5.6-alpine
- name: Build and push 7.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=7.2
ALPINE_VERSION=3.9
push: true
tags: |
aprimediet/php-fpm:7.2-alpine
- name: Build and push 7.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=7.3
ALPINE_VERSION=3.10
push: true
tags: |
aprimediet/php-fpm:7.3-alpine
- name: Build and push 7.4 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=7.4
ALPINE_VERSION=3.13
push: true
tags: |
aprimediet/php-fpm:7.4-alpine
- name: Build and push 8.0 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.0
ALPINE_VERSION=3.16
push: true
tags: |
aprimediet/php-fpm:8.0-alpine
- name: Build and push 8.1 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.1
ALPINE_VERSION=3.18
push: true
tags: |
aprimediet/php-fpm:8.1-alpine
- name: Build and push 8.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.2
ALPINE_VERSION=3.18
push: true
tags: |
aprimediet/php-fpm:8.2-alpine
- name: Build and push 8.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine
build-args: |
PHP_VERSION=8.3
ALPINE_VERSION=3.19
push: true
tags: |
aprimediet/php-fpm:8.3-alpine
aprimediet/php-fpm:latest-alpine
aprimediet/php-fpm:alpine
build-rootless:
name: Build and push image (rootless)
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Winter Access Git Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: aditya.prima
password: ${{ secrets.PATOKEN }}
- name: Build and push 5.6 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=5.6
ALPINE_VERSION=3.5
push: true
tags: |
aprimediet/php-fpm:5.6-alpine-rootless
- name: Build and push 7.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=7.2
ALPINE_VERSION=3.9
push: true
tags: |
aprimediet/php-fpm:7.2-alpine-rootless
- name: Build and push 7.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=7.3
ALPINE_VERSION=3.10
push: true
tags: |
aprimediet/php-fpm:7.3-alpine-rootless
- name: Build and push 7.4 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=7.4
ALPINE_VERSION=3.13
push: true
tags: |
aprimediet/php-fpm:7.4-alpine-rootless
- name: Build and push 8.0 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.0
ALPINE_VERSION=3.16
push: true
tags: |
aprimediet/php-fpm:8.0-alpine-rootless
- name: Build and push 8.1 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.1
ALPINE_VERSION=3.18
push: true
tags: |
aprimediet/php-fpm:8.1-alpine-rootless
- name: Build and push 8.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.2
ALPINE_VERSION=3.18
push: true
tags: |
aprimediet/php-fpm:8.2-alpine-rootless
- name: Build and push 8.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.3
ALPINE_VERSION=3.19
push: true
tags: |
aprimediet/php-fpm:8.3-alpine-rootless
aprimediet/php-fpm:latest-alpine-rootless
aprimediet/php-fpm:alpine-rootless

View File

@ -6,7 +6,7 @@ on:
jobs: jobs:
build: build:
name: Build and push image name: Build and push image (root-user)
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ghcr.io/catthehacker/ubuntu:act-latest image: ghcr.io/catthehacker/ubuntu:act-latest
@ -108,3 +108,108 @@ jobs:
tags: | tags: |
git.winteraccess.id/${{ gitea.repository }}:8.3-alpine git.winteraccess.id/${{ gitea.repository }}:8.3-alpine
git.winteraccess.id/${{ gitea.repository }}:latest-alpine git.winteraccess.id/${{ gitea.repository }}:latest-alpine
git.winteraccess.id/${{ gitea.repository }}:alpine
build-rootless:
name: Build and push image (rootless)
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Winter Access Git Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: aditya.prima
password: ${{ secrets.PATOKEN }}
- name: Build and push 5.6 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=5.6
ALPINE_VERSION=3.5
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:5.6-alpine-rootless
- name: Build and push 7.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=7.2
ALPINE_VERSION=3.9
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:7.2-alpine-rootless
- name: Build and push 7.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=7.3
ALPINE_VERSION=3.10
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:7.3-alpine-rootless
- name: Build and push 7.4 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=7.4
ALPINE_VERSION=3.13
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:7.4-alpine-rootless
- name: Build and push 8.0 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.0
ALPINE_VERSION=3.16
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.0-alpine-rootless
- name: Build and push 8.1 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.1
ALPINE_VERSION=3.18
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.1-alpine-rootless
- name: Build and push 8.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.2
ALPINE_VERSION=3.18
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.2-alpine-rootless
- name: Build and push 8.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.alpine-rootless
build-args: |
PHP_VERSION=8.3
ALPINE_VERSION=3.19
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.3-alpine-rootless
git.winteraccess.id/${{ gitea.repository }}:latest-alpine-rootless
git.winteraccess.id/${{ gitea.repository }}:alpine-rootless

View File

@ -0,0 +1,217 @@
name: Build and Push Ubuntu Image
on:
push:
branches:
- master
jobs:
build:
name: Build and push image (root)
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: docker.io
username: aprimediet
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push 5.6 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=5.6
push: true
tags: |
aprimediet/php-fpm:5.6
aprimediet/php-fpm:5.6-ubuntu
- name: Build and push 7.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=7.2
push: true
tags: |
aprimediet/php-fpm:7.2
aprimediet/php-fpm:7.2-ubuntu
- name: Build and push 7.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=7.3
push: true
tags: |
aprimediet/php-fpm:7.3
aprimediet/php-fpm:7.3-ubuntu
- name: Build and push 7.4 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=7.4
push: true
tags: |
aprimediet/php-fpm:7.4
aprimediet/php-fpm:7.4-ubuntu
- name: Build and push 8.0 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.0
push: true
tags: |
aprimediet/php-fpm:8.0
aprimediet/php-fpm:8.0-ubuntu
- name: Build and push 8.1 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.1
push: true
tags: |
aprimediet/php-fpm:8.1
aprimediet/php-fpm:8.1-ubuntu
- name: Build and push 8.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.2
push: true
tags: |
aprimediet/php-fpm:8.2
aprimediet/php-fpm:8.2-ubuntu
- name: Build and push 8.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu
build-args: |
PHP_VERSION=8.3
push: true
tags: |
aprimediet/php-fpm:8.3
aprimediet/php-fpm:8.3-ubuntu
aprimediet/php-fpm:latest-ubuntu
aprimediet/php-fpm:ubuntu
aprimediet/php-fpm:latest
build-rootless:
name: Build and push image (rootless)
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: aditya.prima
password: ${{ secrets.PATOKEN }}
- name: Build and push 5.6 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=5.6
push: true
tags: |
aprimediet/php-fpm:5.6-rootless
aprimediet/php-fpm:5.6-ubuntu-rootless
- name: Build and push 7.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=7.2
push: true
tags: |
aprimediet/php-fpm:7.2-rootless
aprimediet/php-fpm:7.2-ubuntu-rootless
- name: Build and push 7.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=7.3
push: true
tags: |
aprimediet/php-fpm:7.3-rootless
aprimediet/php-fpm:7.3-ubuntu-rootless
- name: Build and push 7.4 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=7.4
push: true
tags: |
aprimediet/php-fpm:7.4-rootless
aprimediet/php-fpm:7.4-ubuntu-rootless
- name: Build and push 8.0 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.0
push: true
tags: |
aprimediet/php-fpm:8.0-rootless
aprimediet/php-fpm:8.0-ubuntu-rootless
- name: Build and push 8.1 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.1
push: true
tags: |
aprimediet/php-fpm:8.1-rootless
aprimediet/php-fpm:8.1-ubuntu-rootless
- name: Build and push 8.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.2
push: true
tags: |
aprimediet/php-fpm:8.2-rootless
aprimediet/php-fpm:8.2-ubuntu-rootless
- name: Build and push 8.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.3
push: true
tags: |
aprimediet/php-fpm:8.3-rootless
aprimediet/php-fpm:8.3-ubuntu-rootless
aprimediet/php-fpm:latest-ubuntu-rootless
aprimediet/php-fpm:ubuntu-rootless
aprimediet/php-fpm:latest-rootless

View File

@ -6,14 +6,14 @@ on:
jobs: jobs:
build: build:
name: Build and push image name: Build and push image (root)
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ghcr.io/catthehacker/ubuntu:act-latest image: ghcr.io/catthehacker/ubuntu:act-latest
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Login to Docker Winter Access Git Registry - name: Login to Docker Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: git.winteraccess.id registry: git.winteraccess.id
@ -108,4 +108,110 @@ jobs:
git.winteraccess.id/${{ gitea.repository }}:8.3 git.winteraccess.id/${{ gitea.repository }}:8.3
git.winteraccess.id/${{ gitea.repository }}:8.3-ubuntu git.winteraccess.id/${{ gitea.repository }}:8.3-ubuntu
git.winteraccess.id/${{ gitea.repository }}:latest-ubuntu git.winteraccess.id/${{ gitea.repository }}:latest-ubuntu
git.winteraccess.id/${{ gitea.repository }}:ubuntu
git.winteraccess.id/${{ gitea.repository }}:latest git.winteraccess.id/${{ gitea.repository }}:latest
build-rootless:
name: Build and push image (rootless)
runs-on: ubuntu-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: git.winteraccess.id
username: aditya.prima
password: ${{ secrets.PATOKEN }}
- name: Build and push 5.6 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=5.6
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:5.6-rootless
git.winteraccess.id/${{ gitea.repository }}:5.6-ubuntu-rootless
- name: Build and push 7.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=7.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:7.2-rootless
git.winteraccess.id/${{ gitea.repository }}:7.2-ubuntu-rootless
- name: Build and push 7.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=7.3
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:7.3-rootless
git.winteraccess.id/${{ gitea.repository }}:7.3-ubuntu-rootless
- name: Build and push 7.4 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=7.4
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:7.4-rootless
git.winteraccess.id/${{ gitea.repository }}:7.4-ubuntu-rootless
- name: Build and push 8.0 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.0
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.0-rootless
git.winteraccess.id/${{ gitea.repository }}:8.0-ubuntu-rootless
- name: Build and push 8.1 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.1
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.1-rootless
git.winteraccess.id/${{ gitea.repository }}:8.1-ubuntu-rootless
- name: Build and push 8.2 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.2
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.2-rootless
git.winteraccess.id/${{ gitea.repository }}:8.2-ubuntu-rootless
- name: Build and push 8.3 Images
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.ubuntu-rootless
build-args: |
PHP_VERSION=8.3
push: true
tags: |
git.winteraccess.id/${{ gitea.repository }}:8.3-rootless
git.winteraccess.id/${{ gitea.repository }}:8.3-ubuntu-rootless
git.winteraccess.id/${{ gitea.repository }}:latest-ubuntu-rootless
git.winteraccess.id/${{ gitea.repository }}:ubuntu-rootless
git.winteraccess.id/${{ gitea.repository }}:latest-rootless

View File

@ -25,6 +25,10 @@ ADD ./etc /etc
ADD ./scripts/php-fpm-init-alpine /usr/local/bin/php-fpm-init ADD ./scripts/php-fpm-init-alpine /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
ADD https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/master/php-fpm-healthcheck /usr/local/bin
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/*

View File

@ -0,0 +1,41 @@
ARG REGISTRY_URL=git.winteraccess.id/docker
ARG PHP_VERSION=8.3
FROM ${REGISTRY_URL}/php:${PHP_VERSION}-alpine
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
ENV PHP_FPM_BIN=php-fpm${PHP_VERSION}
# ADD USER
RUN addgroup -g 10001 phpfpm && adduser -D -u 10001 -G phpfpm -s /bin/sh -h /app phpfpm
# Set workdir
WORKDIR /
# INSTALL PHP APP
RUN --mount=type=cache,target=/var/cache/apk \
apk upgrade && apk add --update \
php${PHP_VERSION}-fpm
# REMOVE CURRENT POOL FIRST
RUN rm -rf /etc/php${PHP_VERSION}/php-fpm*
# COPY CONFIGURATION FILES
RUN mkdir -p /etc/php/fpm
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
# COPY INIT SCRIPT
ADD ./scripts/php-fpm-init-alpine /usr/local/bin/php-fpm-init
RUN chmod +x /usr/local/bin/php-fpm-init
# INSTALL PHP FPM HEALTHCHECK UTILITIES
ADD https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/master/php-fpm-healthcheck /usr/local/bin
RUN chmod +x /usr/local/bin/php-fpm-healthcheck
# CLEAN APK CACHES
RUN rm -vrf /var/cache/apk/*
USER phpfpm
EXPOSE 9000

View File

@ -24,6 +24,10 @@ ADD ./etc/php/fpm /etc/php/fpm
ADD ./scripts/php-fpm-init /usr/local/bin/php-fpm-init ADD ./scripts/php-fpm-init /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
ADD https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/master/php-fpm-healthcheck /usr/local/bin
RUN chmod +x /usr/local/bin/php-fpm-healthcheck
# CLEAN APT CACHE # CLEAN APT CACHE
RUN apt -y clean RUN apt -y clean

View File

@ -0,0 +1,39 @@
ARG PHP_VERSION=8.3
ARG REGISTRY_URL=git.winteraccess.id/docker
FROM ${REGISTRY_URL}/php:${PHP_VERSION}-ubuntu
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
ENV PHP_FPM_BIN=php-fpm${PHP_VERSION}
# ADD USER
RUN groupadd -g 10001 phpfpm && useradd -D -u 10001 -G phpfpm -s /bin/sh -h /app phpfpm
# Set workdir
WORKDIR /
# INSTALL BASE DEPENDENCIES
RUN --mount=type=cache,target=/var/cache/apt/archives \
apt -y update && apt -y upgrade && apt -y install \
php${PHP_VERSION}-fpm
# REMOVE DEFAULT PHP FPM
RUN rm -rf /etc/php/${PHP_VERSION}/fpm
# COPY CONFIGURATION FILES
ADD ./etc/php/fpm /etc/php/fpm
# COPY INIT SCRIPT
ADD ./scripts/php-fpm-init /usr/local/bin/php-fpm-init
RUN chmod +x /usr/local/bin/php-fpm-init
# INSTALL PHP FPM HEALTHCHECK UTILITIES
ADD https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/master/php-fpm-healthcheck /usr/local/bin
RUN chmod +x /usr/local/bin/php-fpm-healthcheck
# CLEAN APT CACHE
RUN apt -y clean
USER phpfpm
EXPOSE 9000

View File

@ -0,0 +1,55 @@
[www]
;prefix = /path/to/pools/$pool
user = phpfpm
group = phpfpm
listen = 9000
listen.owner = phpfpm
listen.group = phpfpm
;listen.mode = 0660
;listen.acl_users =
;listen.acl_groups =
;listen.allowed_clients = 127.0.0.1
; process.priority = -19
;access.log = /proc/self/fd/2
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
;slowlog = log/$pool.log.slow
;request_slowlog_timeout = 0
;request_terminate_timeout = 0
;rlimit_files = 1024
;rlimit_core = 0
;chroot =
;chdir = /var/www
;catch_workers_output = yes
clear_env = no
;security.limit_extensions = .php .php3 .php4 .php5
;
; WORKER SETTINGS
; COPY AND ADJUST THIS FOR DIFFERENT SCENARIO
;
pm = dynamic
pm.max_children = 10
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 5
pm.process_idle_timeout = 10s;
pm.max_requests = 500
;pm.status_path = /status
;ping.path = /ping
;ping.response = pong
;
; PHP.INI OVERRIDE
; COPY AND ADJUST THIS FOR DIFFERENT SCENARIO
;
php_admin_value[memory_limit] = 128M
php_admin_value[date.timezone] = Asia/Jakarta
php_value[upload_max_filesize]=256M
php_value[post_max_size]=256M
php_value[max_execution_time]=30
php_admin_value[output_buffering]=16384
php_value[session.save_path]="/var/lib/php/session"