Files
serpkah-linktree/Dockerfile
2026-01-11 17:22:31 +01:00

32 lines
630 B
Docker

# Base image
FROM oven/bun:1 AS base
# Set working directory
WORKDIR /app
# Install dependencies with bun
FROM base AS deps
COPY package.json bun.lock* ./
RUN bun install --no-save --frozen-lockfile
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN bun run build -d
# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
# Copy built static site + server
COPY --from=builder /app/dist ./dist
COPY server.ts ./server.ts
EXPOSE 3000
CMD ["bun", "run", "server.ts"]