This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
php-fpm-s6/Dockerfile.ubuntu

45 lines
1.2 KiB
Docker

ARG UBUNTU_VERSION=jammy
ARG REGISTRY_URL=git.winteraccess.id/docker
FROM ${REGISTRY_URL}/ubuntu-s6:${UBUNTU_VERSION}
LABEL maintainer="<Muhamad Aditya Prima> aprimediet@gmail.com"
ARG PHP_VERSION=8.3
ENV PHP_VERSION=${PHP_VERSION}
ENV PHP_FPM_BIN=php-fpm${PHP_VERSION}
# Set workdir at root
WORKDIR /root
RUN --mount=type=cache,target=/var/cache/apt/archives \
apt -y update && apt -y upgrade && apt -y install \
software-properties-common
# ADD PPA TO INSTALL MULTIPLE PHP VERSIONS
RUN add-apt-repository ppa:ondrej/php && apt -y update
# INSTALL BASE DEPENDENCIES
RUN --mount=type=cache,target=/var/cache/apt/archives \
apt -y install \
php${PHP_VERSION}-cli php${PHP_VERSION}-common 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
ADD ./etc/services.d/php-fpm /etc/services.d/php-fpm
# CREATE SYMLINKS TO /usr/bin/php IN CASE IT IS NOT EXISTS
RUN ln -ns /usr/bin/php${PHP_VERSION} /usr/bin/php; exit 0
# CHANGE USER PERMISSION ON /etc/services.d
RUN chmod -R +x /etc/services.d/php-fpm/*
# CLEAN APT CACHES
RUN apt -y clean
# CREATE PHP RUN DIRECTORY
RUN mkdir -p /var/run/php && mkdir -p /var/lib/php/session
EXPOSE 9000