2026-08-16 01:12:25 +02:00
|
|
|
# Image for CI: PHP, Composer and the extensions the suite needs. No runtime
|
|
|
|
|
# server; the frontend build runs in its own job on a node image.
|
|
|
|
|
#
|
|
|
|
|
# Published as incr-ci:php<version>-<revision>, not :latest. Runners cache
|
|
|
|
|
# mutable tags and will not re-pull them, so bump the revision in the tag and
|
|
|
|
|
# in ci.yml whenever this file changes.
|
|
|
|
|
#
|
|
|
|
|
# Debian-based rather than alpine: ffr hit repeated DNS resolution timeouts
|
|
|
|
|
# against codeload.github.com on the alpine build.
|
|
|
|
|
#
|
2026-08-16 10:38:00 +02:00
|
|
|
# pdo_sqlite: tests run against sqlite in memory (see .env.testing). Service
|
|
|
|
|
# containers are not reachable from job containers on this runner, so CI must
|
|
|
|
|
# not depend on one. pdo_mysql is kept so artisan can talk to a real database
|
|
|
|
|
# when run manually inside this image.
|
2026-08-16 01:12:25 +02:00
|
|
|
FROM php:8.3-cli
|
|
|
|
|
|
|
|
|
|
COPY --from=mlocati/php-extension-installer:2 /usr/bin/install-php-extensions /usr/local/bin/
|
|
|
|
|
|
|
|
|
|
RUN install-php-extensions \
|
2026-08-16 10:38:00 +02:00
|
|
|
pdo_sqlite \
|
2026-08-16 01:12:25 +02:00
|
|
|
pdo_mysql \
|
|
|
|
|
mbstring \
|
|
|
|
|
dom \
|
|
|
|
|
xml \
|
|
|
|
|
bcmath \
|
|
|
|
|
fileinfo \
|
|
|
|
|
pcntl \
|
|
|
|
|
gd \
|
|
|
|
|
pcov
|
|
|
|
|
|
|
|
|
|
# nodejs is not used by the app's tests; the Forgejo JavaScript actions
|
|
|
|
|
# (checkout, cache) are executed with it inside this container.
|
2026-08-16 09:38:29 +02:00
|
|
|
# The MySQL readiness check in ci.yml uses PHP's fsockopen, so no netcat here.
|
2026-08-16 01:12:25 +02:00
|
|
|
RUN apt-get update \
|
2026-08-16 09:38:29 +02:00
|
|
|
&& apt-get install -y --no-install-recommends git unzip nodejs \
|
2026-08-16 01:12:25 +02:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|