# 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 FROM oven/bun:1-slim RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/* 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"]