Files
classroomio/docker/Dockerfile.jobs
T

37 lines
1.3 KiB
Docker
Raw Normal View History

FROM node:20-bookworm-slim
# ffmpeg is needed for media probe / thumbnail / audio-extract / transcode tasks.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Keep install non-interactive and deterministic in CI/container contexts.
ENV CI=true
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable && corepack prepare pnpm@10.19.0 --activate
# Fetch deps from the lockfile first (cached unless pnpm-lock.yaml changes); the
# store is baked into this layer and reused by the offline install below. `pnpm
# fetch` populates the store for the whole lockfile, so no hand-maintained package
# list. Mirrors the api/dashboard images.
COPY pnpm-lock.yaml ./
# Patches referenced by package.json#pnpm.patchedDependencies must be present for `pnpm fetch`.
COPY patches ./patches
RUN pnpm fetch --store-dir /pnpm/store
COPY . .
RUN pnpm install --offline --frozen-lockfile --ignore-scripts \
--store-dir /pnpm/store --filter @cio/jobs-worker...
RUN find . -name 'tsconfig.tsbuildinfo' -delete
# Build the worker and all its workspace deps in topological order.
RUN pnpm -r --filter @cio/jobs-worker... build
# Run all worker entrypoints by default. Override CMD to scale media / transcribe
# / maintenance independently.
CMD ["node", "apps/jobs/dist/index.js"]