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
2 changes: 1 addition & 1 deletion .github/workflows/update-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
echo "::notice::ServerSideUp $newest is a new major version. Upgrade by hand."
fi
if [ "$latest" != "$current" ] && [ "$(printf '%s\n%s\n' "$current" "$latest" | sort -V | tail -n1)" = "$latest" ]; then
sed -i "s/^ARG SERVERSIDEUP_VERSION='$current'$/ARG SERVERSIDEUP_VERSION='$latest'/" src/Dockerfile
sed -i "s/^ARG SERVERSIDEUP_VERSION='$current'$/ARG SERVERSIDEUP_VERSION='$latest'/" src/Dockerfile src/ci.Dockerfile
echo "update=$latest" >> "$GITHUB_OUTPUT"
echo "current=$current" >> "$GITHUB_OUTPUT"
fi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Pull instead of building: every laptop, CI runner and server uses the same image
| --- | --- |
| `php8.5-prod` (also `php8.5-frankenphp-debian`, `php8.5-base`, `latest`) | Production: copy your app into it in your own Dockerfile |
| `php8.5-dev` | Local development: mount your project, no build step |
| `php8.5-ci` | CI pipelines: PHP CLI with pcov, Composer, Node.js, Bun and Playwright Chromium. `/etc/playwright-version` names the Playwright version the browsers belong to |
| `php8.5-ci` | CI pipelines (Debian 13, ServerSideUp PHP CLI base): PHP CLI with pcov, Composer, Node.js, Bun and Playwright Chromium. `/etc/playwright-version` names the Playwright version the browsers belong to |
| `php8.4-*`, `php8.3-*` | The same runtime and dev images on PHP 8.4 and 8.3 |

Every release also publishes versioned tags such as `php8.5-prod-v2.0.0` and `php8.5-dev-v2.0.0`. Pin a versioned tag in production. The plain tags follow `main`. They are rebuilt whenever `src/` changes, and every Monday so that Debian security updates reach them.
Expand Down
59 changes: 30 additions & 29 deletions src/ci.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,45 @@
# PHP 8.5 CLI + Composer + Bun + Node.js LTS + Playwright Chromium.
# Published to Docker Hub as laravoltdev/image:php8.5-ci
#
# Built on the ServerSideUp PHP CLI image (Debian 13 trixie), the same release
# as the runtime image. Until 23 Nov 2026 it was Ubuntu 24.04 with PHP from the
# ondrej/php PPA, whose download server failed three weekly publishes in a row.
#
# Does NOT include: FrankenPHP, sqlsrv, or runtime server components.
# Use the runtime image (laravoltdev/image:php8.5-prod) for deployments.

FROM ubuntu:24.04
ARG PHP_VERSION=8.5
# ServerSideUp release, kept equal to src/Dockerfile (update-base-image bumps both).
ARG SERVERSIDEUP_VERSION='v5.1.2'

FROM serversideup/php:${PHP_VERSION}-cli-trixie-${SERVERSIDEUP_VERSION}

USER root
# PHP_MEMORY_LIMIT: CLI tools in CI (PHPStan, Pest) need more than the base
# image's 256M; -1 matches the CLI default of the Ubuntu-based image.
ENV DEBIAN_FRONTEND=noninteractive \
PLAYWRIGHT_BROWSERS_PATH=/root/.cache/ms-playwright
PLAYWRIGHT_BROWSERS_PATH=/root/.cache/ms-playwright \
PHP_MEMORY_LIMIT=-1

ARG PHP_VERSION=8.5
ARG PHP_VERSION
ARG COMPOSER_VERSION=2.10.3
ARG BUN_VERSION=1.4.3
ARG NODE_MAJOR=24
ARG PLAYWRIGHT_VERSION=1.64.1

# PHP 8.5 CLI + extensions required by Laravolt projects.
# sockets is built into php8.5-cli; pcov replaces xdebug as the coverage driver
# (lighter, no "zend_mm_heap corrupted" crashes with pest --type-coverage).
# sqlite3 for in-memory test databases. No sqlsrv — tests use SQLite.
# add-apt-repository looks the PPA key up on the Launchpad API, which can time
# out on a runner (16 Nov 2026 arm64 publish), so it gets a few tries; apt
# retries its own downloads.
RUN echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
software-properties-common ca-certificates curl gnupg git unzip \
&& for i in 1 2 3 4 5; do \
add-apt-repository -y ppa:ondrej/php && break; \
[ "$i" = 5 ] && exit 1; \
sleep $((i * 15)); \
done \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
php${PHP_VERSION}-cli php${PHP_VERSION}-mbstring php${PHP_VERSION}-xml \
php${PHP_VERSION}-curl php${PHP_VERSION}-zip php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-intl php${PHP_VERSION}-gd php${PHP_VERSION}-sqlite3 \
php${PHP_VERSION}-pcov sqlite3 \
&& update-alternatives --set php /usr/bin/php${PHP_VERSION} \
# Extensions required by Laravolt projects, built by install-php-extensions from
# the base image (Debian packages + PECL, no PPA). pcov replaces xdebug as the
# coverage driver (lighter, no "zend_mm_heap corrupted" crashes with
# pest --type-coverage). sqlite3 for in-memory test databases. No sqlsrv: tests
# use SQLite. Pending Debian security updates are applied first.
RUN apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& apt-get install -y --no-install-recommends ca-certificates curl git unzip sqlite3 \
&& install-php-extensions bcmath gd intl pcov sockets zip pdo_sqlite \
&& rm -rf /var/lib/apt/lists/* \
&& php -v \
&& php -m | grep -qx sockets \
&& php -m | grep -qx pcov \
&& test "$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')" = "${PHP_VERSION}" \
&& for ext in bcmath gd intl pcov sockets zip pdo_sqlite; do php -m | grep -qx "$ext" || exit 1; done \
&& ! php -m | grep -qi xdebug

# Composer (pinned version)
Expand Down Expand Up @@ -76,5 +73,9 @@ RUN npx playwright@${PLAYWRIGHT_VERSION} install --with-deps chromium \

RUN rm -rf /tmp/* /var/tmp/*

# Plain shell like the Ubuntu-based image: no ServerSideUp entrypoint, root user.
ENTRYPOINT []
CMD ["/bin/bash"]

LABEL org.opencontainers.image.title="laravolt-ci" \
org.opencontainers.image.description="CI image for Laravolt projects: PHP ${PHP_VERSION} (pcov), Composer ${COMPOSER_VERSION}, Node.js ${NODE_MAJOR}.x, Bun ${BUN_VERSION}, Playwright ${PLAYWRIGHT_VERSION} Chromium"
org.opencontainers.image.description="CI image for Laravolt projects (Debian 13): PHP ${PHP_VERSION} (pcov), Composer ${COMPOSER_VERSION}, Node.js ${NODE_MAJOR}.x, Bun ${BUN_VERSION}, Playwright ${PLAYWRIGHT_VERSION} Chromium"