Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
build:
uses: specsnl/github-actions/.github/workflows/build-php.yml@1.2.3
uses: specsnl/github-actions/.github/workflows/build-php.yml@2.1.0
strategy:
fail-fast: false
matrix:
Expand All @@ -38,7 +38,7 @@ jobs:
dockerfile: ${{ matrix.docker.dockerfile }}

merge:
uses: specsnl/github-actions/.github/workflows/merge-php.yml@1.2.3
uses: specsnl/github-actions/.github/workflows/merge-php.yml@2.1.0
needs: build
strategy:
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:

jobs:
build:
uses: specsnl/github-actions/.github/workflows/build-php.yml@1.2.3
uses: specsnl/github-actions/.github/workflows/build-php.yml@2.1.0
strategy:
fail-fast: false
matrix:
Expand All @@ -37,7 +37,7 @@ jobs:
dockerfile: ${{ matrix.docker.dockerfile }}

merge:
uses: specsnl/github-actions/.github/workflows/merge-php.yml@1.2.3
uses: specsnl/github-actions/.github/workflows/merge-php.yml@2.1.0
needs: build
strategy:
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:

jobs:
build:
uses: specsnl/github-actions/.github/workflows/build-php.yml@1.2.3
uses: specsnl/github-actions/.github/workflows/build-php.yml@2.1.0
strategy:
fail-fast: false
matrix:
Expand All @@ -38,7 +38,7 @@ jobs:
dockerfile: ${{ matrix.docker.dockerfile }}

merge:
uses: specsnl/github-actions/.github/workflows/merge-php.yml@1.2.3
uses: specsnl/github-actions/.github/workflows/merge-php.yml@2.1.0
needs: build
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

vars:
DOCKER_REPO: ghcr.io
DOCKER_OWNER: ilyes512
DOCKER_OWNER: specsnl
# Latatest version of Hadolint: https://hub.docker.com/r/hadolint/hadolint/tags or https://github.com/hadolint/hadolint/releases
HADOLINT_TAG_VERSION: v2.14.0

Expand Down
156 changes: 27 additions & 129 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# check=error=true

# Latest version of PHP base image: https://hub.docker.com/_/php/tags
FROM php:8.4.21-apache-trixie AS runtime
FROM php:8.4.22-apache-trixie AS runtime

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -16,117 +16,38 @@ ARG XDG_CACHE_HOME=/cache
ENV XDG_CACHE_HOME=$XDG_CACHE_HOME

# Latest version of event-extension: https://packagist.org/packages/osmanov/pecl-event
ARG PHP_EVENT_VERSION=3.1.5
ARG PHP_EVENT_VERSION=3.1.4
# Latest version of igbinary-extension: https://packagist.org/packages/igbinary/igbinary
ARG PHP_IGBINARY_VERSION=3.2.17RC1
# Latest version of redis-extension: https://packagist.org/packages/phpredis/phpredis
ARG PHP_REDIS_VERSION=6.3.0
# Latest version of amqp-extension: https://packagist.org/packages/php-amqp/php-amqp
ARG PHP_AMQP_VERSION=2.2.0

ENV SMTPHOST=mail
ENV SMTPEHLO=localhost

WORKDIR /var/www

# Latest version of Pie: https://github.com/php/pie/releases
COPY --from=ghcr.io/php/pie:1.4.5-bin /pie /usr/bin/pie

RUN apt-get update \
RUN --mount=type=bind,from=mlocati/php-extension-installer:2.11.9,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
apt-transport-https \
ca-certificates \
openssl \
curl \
msmtp-mta \
unzip \
# Dependency of the PHP intl-extension
libicu76 \
# Dependency of the PHP gd-extension
libpng16-16t64 \
libwebp7 \
libjpeg62-turbo \
libfreetype6 \
# Dependency of PHP zip-extension
libzip5 \
# Dependency of PHP event-extension
libevent-2.1-7t64 \
libevent-openssl-2.1-7t64 \
libevent-extra-2.1-7t64 \
# Dependency of PHP pdo_pgsql-extension
libpq5 \
# Dependency of PHP amqp-extension
librabbitmq4 \
# Dependency of PHP xsl-extension
libxslt1.1 \
# Install packages that are needed for building PHP extensions
&& apt-get install --assume-yes --no-install-recommends \
$PHPIZE_DEPS \
# Dependency of the PHP intl-extension
libicu-dev \
# Dependencies of PHP gd-extension
libpng-dev \
libwebp-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
# Dependency of PHP zip-extension
libzip-dev \
# Dependency of PHP event-extension
libevent-dev \
libssl-dev \
# Dependency of PHP soap-extension
libxml2-dev \
# Dependency of PHP pdo_pgsql-extension
libpq-dev \
# Dependency of PHP amqp-extension
librabbitmq-dev \
# Dependency of PHP xsl-extension
libxslt1-dev \
# Configure PHP gd-extension
&& docker-php-ext-configure gd \
--enable-gd \
--with-jpeg \
--with-freetype \
--with-webp \
# Install PHP extensions
&& docker-php-ext-install -j "$(nproc --all)" \
&& install-php-extensions \
pdo_mysql \
pdo_pgsql \
intl \
opcache \
pcntl \
gd \
bcmath \
zip \
soap \
xsl \
# Dependency of PHP event-extension
sockets \
&& pie install --skip-enable-extension osmanov/pecl-event:$PHP_EVENT_VERSION \
&& pie install --skip-enable-extension igbinary/igbinary:$PHP_IGBINARY_VERSION \
&& pie install --skip-enable-extension php-amqp/php-amqp:$PHP_AMQP_VERSION \
&& pie install --skip-enable-extension phpredis/phpredis:$PHP_REDIS_VERSION --enable-redis-igbinary \
&& docker-php-ext-enable --ini-name docker-php-ext-zz-custom.ini \
event \
igbinary \
redis \
amqp \
"event-$PHP_EVENT_VERSION" \
"igbinary-$PHP_IGBINARY_VERSION" \
"redis-$PHP_REDIS_VERSION" \
"amqp-$PHP_AMQP_VERSION" \
&& cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
# Purge packages that where only needed for building php extensions
&& apt-get purge --assume-yes \
$PHPIZE_DEPS \
libicu-dev \
libpng-dev \
libwebp-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libzip-dev \
libevent-dev \
libssl-dev \
libxml2-dev \
libpq-dev \
librabbitmq-dev \
libxslt1-dev \
&& mkdir -p \
$XDG_CONFIG_HOME \
$XDG_DATA_HOME \
Expand All @@ -140,52 +61,39 @@ RUN apt-get update \

COPY files/general /

FROM composer:2.10.1 AS composer

FROM runtime AS builder

ARG TARGETARCH
ARG DEBIAN_FRONTEND=noninteractive

# Latest version of Phive: https://api.github.com/repos/phar-io/phive/releases/latest
ARG PHIVE_VERSION=0.16.0
# Latest version of Composer: https://getcomposer.org/download
ARG COMPOSER_VERSION=2.10.1
# Latest version of Xdebug: https://packagist.org/packages/xdebug/xdebug
ARG XDEBUG_VERSION=3.5.1
ARG XDEBUG_VERSION=3.5.3
# Latest version of pcov: https://packagist.org/packages/pecl/pcov
ARG PCOV_VERSION=1.0.12

RUN apt-get update \
RUN --mount=type=bind,from=mlocati/php-extension-installer:2.11.9,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \
apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
# Needed for xdebug extension configuration
$PHPIZE_DEPS \
vim \
git \
sqlite3 \
wait-for-it \
p7zip-full \
# Needed for phive:
gnupg \
# Install Phive
&& curl -fsSLo /usr/local/bin/phive "https://github.com/phar-io/phive/releases/download/$PHIVE_VERSION/phive-$PHIVE_VERSION.phar" \
&& curl -fsSLo /tmp/phive.phar.asc "https://github.com/phar-io/phive/releases/download/$PHIVE_VERSION/phive-$PHIVE_VERSION.phar.asc" \
&& gpg --keyserver keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 \
&& gpg --verify /tmp/phive.phar.asc /usr/local/bin/phive \
&& chmod +x /usr/local/bin/phive \
&& phive update-repository-list \
# Install Composer using Phive
&& phive install --global composer:$COMPOSER_VERSION --trust-gpg-keys CBB3D576F2A0946F \
&& rm -rf /root/.phive \
unzip \
curl \
# Download Composer keys
&& mkdir -p "$XDG_CONFIG_HOME/composer" \
&& curl -fsSLo "$XDG_CONFIG_HOME/composer/keys.dev.pub" https://composer.github.io/snapshots.pub \
&& curl -fsSLo "$XDG_CONFIG_HOME/composer/keys.tags.pub" https://composer.github.io/releases.pub \
&& chmod 644 "$XDG_CONFIG_HOME/composer/keys.dev.pub" "$XDG_CONFIG_HOME/composer/keys.tags.pub" \
# Install Xdebug and pcov PHP extensions
&& pie install xdebug/xdebug:$XDEBUG_VERSION \
&& pie install pecl/pcov:$PCOV_VERSION \
&& install-php-extensions \
"xdebug-$XDEBUG_VERSION" \
"pcov-$PCOV_VERSION" \
&& cp "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" \
# Cleanup
&& apt-get purge --assume-yes $PHPIZE_DEPS \
&& apt-get autoremove --assume-yes \
&& apt-get clean --assume-yes \
&& rm -rf /var/lib/apt/lists/* \
Expand All @@ -198,7 +106,6 @@ ARG USER=code
ARG GROUP=code
ARG USER_UID=1000
ARG USER_GID=1000
ARG TARGETARCH

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand All @@ -218,7 +125,7 @@ RUN curl -fsSLo /tmp/fixuid.tar.gz "https://github.com/boxboat/fixuid/releases/d
/etc/fixuid \
"/data" \
"/config" \
"/cache" \
"/cache/npm" \
&& chown -R "$USER_UID":"$USER_GID" \
"/data" \
"/config" \
Expand All @@ -235,35 +142,26 @@ paths:

EOF

COPY --from=composer /usr/bin/composer /usr/bin/composer

FROM node:24.16.0-trixie-slim AS node

FROM builder AS builder_nodejs

ARG TARGETARCH
ARG DEBIAN_FRONTEND=noninteractive

ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
ENV npm_config_cache="$XDG_CACHE_HOME/npm"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Latest version of Node.js: https://nodejs.org
ARG NODE_MAJOR=24
COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules

RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
gcc \
g++ \
make \
&& mkdir -p /usr/share/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg \
&& chmod 644 /usr/share/keyrings/nodesource.gpg \
&& echo "deb [arch=$TARGETARCH signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& echo "Package: nodejs" | tee /etc/apt/preferences.d/nodejs > /dev/null \
&& echo "Pin: origin deb.nodesource.com" | tee -a /etc/apt/preferences.d/nodejs > /dev/null \
&& echo "Pin-Priority: 600" | tee -a /etc/apt/preferences.d/nodejs > /dev/null \
&& apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
nodejs \
&& npm uninstall --global npm \
&& ln -s ../lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack \
&& corepack install --global npm@11.x yarn@4.x pnpm@10.x \
&& corepack enable npm yarn pnpm \
# Cleanup
Expand Down
Loading