ops/devops: add offline console runner image scaffold
This commit is contained in:
40
ops/devops/console/Dockerfile.runner
Normal file
40
ops/devops/console/Dockerfile.runner
Normal file
@@ -0,0 +1,40 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
# Offline-friendly console CI runner image with pre-baked npm and Playwright caches (DEVOPS-CONSOLE-23-001)
|
||||
ARG BASE_IMAGE=node:20-bookworm-slim
|
||||
ARG APP_DIR=src/Web/StellaOps.Web
|
||||
ARG SOURCE_DATE_EPOCH=1704067200
|
||||
|
||||
FROM ${BASE_IMAGE}
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
NPM_CONFIG_FUND=false \
|
||||
NPM_CONFIG_AUDIT=false \
|
||||
NPM_CONFIG_PROGRESS=false \
|
||||
SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \
|
||||
PLAYWRIGHT_BROWSERS_PATH=/home/runner/.cache/ms-playwright \
|
||||
NPM_CONFIG_CACHE=/home/runner/.npm \
|
||||
CI=true
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends git ca-certificates dumb-init wget curl && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN useradd -m -u 1000 runner
|
||||
|
||||
WORKDIR /tmp/console-seed
|
||||
COPY ${APP_DIR}/package.json ${APP_DIR}/package-lock.json ./
|
||||
|
||||
ENV npm_config_cache=/tmp/npm-cache
|
||||
RUN npm ci --cache ${npm_config_cache} --prefer-offline --no-audit --progress=false --ignore-scripts && \
|
||||
PLAYWRIGHT_BROWSERS_PATH=/tmp/ms-playwright npx playwright install chromium --with-deps && \
|
||||
rm -rf node_modules
|
||||
|
||||
RUN install -d -o runner -g runner /home/runner/.npm /home/runner/.cache && \
|
||||
mv /tmp/npm-cache /home/runner/.npm && \
|
||||
mv /tmp/ms-playwright /home/runner/.cache/ms-playwright && \
|
||||
chown -R runner:runner /home/runner/.npm /home/runner/.cache
|
||||
|
||||
WORKDIR /workspace
|
||||
USER runner
|
||||
ENTRYPOINT ["/usr/bin/dumb-init","--"]
|
||||
CMD ["/bin/bash"]
|
||||
Reference in New Issue
Block a user