Files
joel/Dockerfile
2026-02-26 14:49:43 +01:00

42 lines
836 B
Docker

# Build stage
FROM oven/bun:1 AS builder
WORKDIR /app
# 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"]