Files
twotalesanimation 81ad7e4ea9 Initial commit
2026-06-11 10:46:09 +02:00

45 lines
1.1 KiB
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# syntax=docker/dockerfile:1
# ---------------------------------------------------------------------------
# Stage 1 Build TypeScript
# ---------------------------------------------------------------------------
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
# ---------------------------------------------------------------------------
# Stage 2 Runtime image
# ---------------------------------------------------------------------------
FROM node:20-alpine AS runner
# Install FFmpeg (includes ffprobe).
RUN apk add --no-cache ffmpeg
WORKDIR /app
# Production dependencies only.
COPY package*.json ./
RUN npm install --omit=dev
# Compiled output from builder stage.
COPY --from=builder /app/dist ./dist
# Non-root user for defence-in-depth.
RUN addgroup -g 1001 -S transcoder \
&& adduser -u 1001 -S transcoder -G transcoder
# Work directory the worker uses for temp files.
RUN mkdir -p /work && chown transcoder:transcoder /work
USER transcoder
CMD ["npm", "run", "start"]