Files
netfelix-audio-fix/Dockerfile
T
felixfoertsch ce37aec647
Build and Push Docker Image / build (push) Successful in 8m49s
use debian base for runtime stage so ffmpeg layer caches independently
the oven/bun:1-slim tag resolves to a new digest frequently, busting
the apt-get ffmpeg layer (5+ minutes). switching to debian:bookworm-slim
keeps that layer stable. bun is copied as a single binary from the
build stage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-20 10:34:33 +02:00

28 lines
990 B
Docker

# syntax=docker/dockerfile:1.7
FROM oven/bun:1-slim AS build
WORKDIR /app
# Install deps first for layer caching — only rebuilds when the lockfile changes.
COPY package.json bun.lock ./
RUN --mount=type=cache,target=/root/.bun/install/cache \
bun install --frozen-lockfile
COPY . .
RUN bun run build
# Runtime: start from Debian to keep the ffmpeg layer stable even when the bun
# tag resolves to a new digest. Bun is a single static binary — just copy it.
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=build /usr/local/bin/bun /usr/local/bin/bun
WORKDIR /app
COPY package.json bun.lock ./
RUN --mount=type=cache,target=/root/.bun/install/cache \
bun install --frozen-lockfile --production
COPY --from=build /app/dist/ ./dist/
COPY --from=build /app/server/ ./server/
EXPOSE 3000
ENV DATA_DIR=/data/
ENV PORT=3000
VOLUME ["/data/"]
CMD ["bun", "run", "server/index.tsx"]