CI: custom runner-base image, Node 22, pip caching
- infra/Dockerfile.runner-base: new Ubuntu 24.04 image with Python 3.12 and Node 22 LTS pre-installed, tagged py3.12-node22. Eliminates the ~3-4 min deadsnakes PPA install that ran on every test job. - infra/runner-compose.yml: update ubuntu-latest label to use runner-base:py3.12-node22 instead of node:20-bullseye. - .forgejo/workflows/ci.yml: remove Python 3.12 install steps (now in base image), add actions/cache for pip keyed on pyproject.toml hash, bump node-version 20 → 22. - Dockerfile: bump frontend build stage node:20-alpine → node:22-alpine. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Runner base image for Forgejo act_runner job containers.
|
||||
# Pre-installs Python 3.12 and Node 20 so the test job skips the
|
||||
# ~3-4 minute deadsnakes PPA install on every run.
|
||||
#
|
||||
# Build and push (one-time setup, re-run if this file changes):
|
||||
# docker build -f infra/Dockerfile.runner-base \
|
||||
# -t git.fabledsword.com/bvandeusen/runner-base:py3.12-node22 .
|
||||
# docker push git.fabledsword.com/bvandeusen/runner-base:py3.12-node22
|
||||
#
|
||||
# Then redeploy the act_runner stack in Portainer to pick up the new label.
|
||||
|
||||
FROM ubuntu:24.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Python 3.12 ships in Ubuntu 24.04 main repos — no PPA needed.
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -y -qq \
|
||||
python3.12 python3.12-dev python3.12-venv python3-pip \
|
||||
git curl ca-certificates gnupg && \
|
||||
# Node 22 LTS via NodeSource
|
||||
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/*
|
||||
@@ -13,7 +13,7 @@ services:
|
||||
- GITEA_RUNNER_REGISTRATION_TOKEN=${RUNNER_TOKEN}
|
||||
- GITEA_RUNNER_NAME=swarm-runner
|
||||
# Maps the runs-on: ubuntu-latest label used in workflow files to a Docker image.
|
||||
- GITEA_RUNNER_LABELS=ubuntu-latest:docker://node:20-bullseye
|
||||
- GITEA_RUNNER_LABELS=ubuntu-latest:docker://git.fabledsword.com/bvandeusen/runner-base:py3.12-node22
|
||||
- CONFIG_FILE=/config/config.yml
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
Reference in New Issue
Block a user