32 lines
669 B
Docker
32 lines
669 B
Docker
FROM oven/bun:latest AS deps
|
|
WORKDIR /app
|
|
COPY package.json bun.lock* ./
|
|
RUN bun install --frozen-lockfile 2>/dev/null || bun install
|
|
|
|
FROM oven/bun:latest AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
# Ensure public folder exists for the build
|
|
RUN mkdir -p public
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
RUN bun run build
|
|
|
|
FROM oven/bun:latest AS runner
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/.next/standalone ./
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
|
|
EXPOSE 3000
|
|
ENV PORT=3000
|
|
ENV HOSTNAME="0.0.0.0"
|
|
|
|
CMD ["bun", "server.js"]
|