incr/docker/build/Dockerfile.ci
myrmidex 68ed294b82
Some checks failed
CI / ci (push) Failing after 1s
CI / build (push) Failing after 27s
Build and Push CI Image / images (docker/build/Dockerfile.ci, incr-ci, php8.3-3) (push) Successful in 7m6s
CI / ci (pull_request) Failing after 1m17s
CI / build (pull_request) Failing after 34s
46 - Squash migrations and run CI against sqlite
2026-08-16 10:38:00 +02:00

38 lines
1.4 KiB
Text

# 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.
#
# 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.
FROM php:8.3-cli
COPY --from=mlocati/php-extension-installer:2 /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions \
pdo_sqlite \
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.
# The MySQL readiness check in ci.yml uses PHP's fsockopen, so no netcat here.
RUN apt-get update \
&& apt-get install -y --no-install-recommends git unzip nodejs \
&& rm -rf /var/lib/apt/lists/*
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer