47 lines
898 B
Docker
47 lines
898 B
Docker
# Build stage
|
|
FROM oven/bun:latest AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install ffmpeg and other system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy package files
|
|
COPY package.json bun.lock ./
|
|
|
|
# Install dependencies with bun
|
|
RUN bun install --frozen-lockfile
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN bun run build
|
|
|
|
# Runtime stage
|
|
FROM oven/bun:latest
|
|
|
|
WORKDIR /app
|
|
|
|
# Install ffmpeg in runtime image as well
|
|
RUN apt-get update && apt-get install -y \
|
|
ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy package files
|
|
COPY package.json bun.lock ./
|
|
|
|
# Install dependencies (production only)
|
|
RUN bun install --frozen-lockfile --production
|
|
|
|
# Copy built application from builder
|
|
COPY --from=builder /app/build ./build
|
|
|
|
# Expose port 3000
|
|
EXPOSE 3000
|
|
|
|
# Start the application
|
|
CMD ["bun", "--bun", "run", "build/index.js"]
|