-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.precommit
More file actions
29 lines (22 loc) · 955 Bytes
/
Copy pathDockerfile.precommit
File metadata and controls
29 lines (22 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Pre-commit runner image: bundles git, uv, python, node, and shellcheck so
# Linux/Windows devs can run the full hook suite without local installs.
#
# Build: docker build -f Dockerfile.precommit -t waldo-precommit .
# Run: docker compose -f docker-compose.precommit.yml run --rm precommit
FROM python:3.11-slim
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PRE_COMMIT_HOME=/root/.cache/pre-commit
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
ca-certificates \
shellcheck \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
RUN uv pip install --system pre-commit ruff detect-secrets
WORKDIR /workspace
# Pre-warm the hook cache by running install-hooks against a stub config when
# the real one is mounted; no-op on first build, fast on subsequent runs.
CMD ["pre-commit", "run", "--all-files"]