Files
FabledScribe/infra/Dockerfile.runner-base
T
bvandeusen 8d07b6c79e ci: new ci-runner base image + uv/ruff/node_modules cache
Runner base image (infra/Dockerfile.runner-base):
- Added uv (fast Python package installer, ~10x faster than pip)
- Added ruff (baked in, lint job drops from ~13s to ~2s)
- Added jq + tzdata
- Renamed tag from py3.12-node22 to ci-runner (purpose over contents)

Workflow (ci.yml):
- typecheck: cache node_modules directly instead of npm download cache;
  skip npm ci entirely on cache hits (9m41s → ~30s expected)
- lint: just `ruff check src/` — no venv, no install
- test: uv venv + uv pip install replaces pip (~10x faster resolves)
- all jobs: runs-on ci-runner label

Baseline: typecheck 9m41s, lint 13s, test 1m42s
2026-04-11 23:59:57 -04:00

49 lines
2.0 KiB
Docker

# Runner base image for Forgejo act_runner job containers.
# Pre-installs Python 3.12, Node 22, uv, and ruff so workflows skip
# lengthy runtime installs on every run.
#
# Build and push (re-run when this file changes):
# docker build -f infra/Dockerfile.runner-base \
# -t git.fabledsword.com/bvandeusen/runner-base:ci-runner .
# docker push git.fabledsword.com/bvandeusen/runner-base:ci-runner
#
# Then redeploy the act_runner stack in Portainer to pick up the new image.
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
# Split into separate RUN steps so each pushed layer is smaller — one
# combined layer exceeds the nginx upload timeout on the self-hosted
# Forgejo registry.
# Python 3.12 (ships in Ubuntu 24.04 main repos) + core tools
RUN apt-get update -qq && \
apt-get install -y -qq \
python3.12 python3.12-dev python3.12-venv \
git curl ca-certificates gnupg jq tzdata && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Node 22 LTS via NodeSource
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y -qq nodejs && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Docker CLI — daemon comes from the host socket mount, only CLI needed.
# docker.io from Ubuntu repos is sufficient for docker login + buildx.
RUN apt-get update -qq && \
apt-get install -y -qq docker.io && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# uv — fast Python package installer/resolver (~10x faster than pip).
# Used by test jobs instead of pip for venv creation + dep installs.
RUN curl -LsSf https://astral.sh/uv/install.sh | env INSTALLER_NO_MODIFY_PATH=1 sh && \
mv /root/.local/bin/uv /usr/local/bin/ && \
mv /root/.local/bin/uvx /usr/local/bin/
# ruff — Python linter. Baked in so the lint job is just
# `ruff check src/` with zero install overhead.
RUN curl -LsSf https://astral.sh/ruff/install.sh | env INSTALLER_NO_MODIFY_PATH=1 sh && \
mv /root/.local/bin/ruff /usr/local/bin/