Files
desa-darmasaba/Dockerfile
bipproduction 790d6535e5 fix: perbaiki Dockerfile - lockfile, bunfig.toml, dan path build output
- Ganti bun.lock → bun.lockb (nama file yang benar)
- Hapus bunfig.toml dari COPY (file tidak ada)
- Ganti /app/dist → /app/.next (output Next.js build)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 13:15:54 +08:00

49 lines
1.0 KiB
Docker

FROM debian:bookworm-slim AS base
RUN apt-get update && apt-get install -y --no-install-recommends \
curl unzip ca-certificates libssl3 && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:$PATH"
WORKDIR /app
# ---- deps ----
FROM base AS deps
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
# ---- builder ----
FROM deps AS builder
COPY prisma ./prisma
RUN bunx prisma generate
COPY src ./src
COPY types ./types
COPY tsconfig.json ./
# BUN_PUBLIC_* vars are baked into the browser bundle at build time
ARG BUN_PUBLIC_BASE_URL
ENV BUN_PUBLIC_BASE_URL=${BUN_PUBLIC_BASE_URL}
RUN bun run build
# ---- runner ----
FROM base AS runner
COPY package.json bun.lockb ./
RUN bun install --production
COPY --from=builder /app/generated ./generated
COPY --from=builder /app/.next ./.next
COPY src ./src
COPY prisma ./prisma
COPY types ./types
COPY tsconfig.json ./
ENV NODE_ENV=production
EXPOSE 3000
CMD ["bun", "run", "./src/index.tsx"]