# Build stage FROM oven/bun:1 AS builder WORKDIR /app # Native modules built via node-gyp need Python and a C/C++ toolchain. RUN apt-get update \ && apt-get install -y --no-install-recommends python3 python-is-python3 make g++ \ && rm -rf /var/lib/apt/lists/* # Copy package files COPY package.json bun.lockb ./ # Install dependencies RUN bun install --frozen-lockfile # Copy source code COPY src ./src COPY tsconfig.json drizzle.config.ts ./ # Production stage FROM oven/bun:1-slim WORKDIR /app # Install runtime dependencies RUN apt-get update \ && apt-get install -y --no-install-recommends ffmpeg \ && rm -rf /var/lib/apt/lists/* # Copy from builder COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/src ./src COPY --from=builder /app/package.json ./ COPY --from=builder /app/tsconfig.json ./ # Set environment variables ENV NODE_ENV=production ENV LOG_LEVEL=info ENV DATABASE_PATH=/data/db.sqlite3 # Persist runtime data (SQLite) VOLUME ["/data"] # Run the bot CMD ["bun", "run", "src/index.ts"]