|
|
|
|
|
FROM oven/bun:1 AS base |
|
|
|
|
|
FROM base AS deps |
|
WORKDIR /app |
|
|
|
|
|
COPY --link package.json bun.lockb* ./ |
|
RUN bun install --frozen-lockfile |
|
|
|
|
|
FROM base AS builder |
|
WORKDIR /app |
|
COPY --from=deps --link /app/node_modules ./node_modules |
|
COPY --link . . |
|
|
|
|
|
|
|
|
|
|
|
RUN bun run build |
|
|
|
|
|
FROM base AS runner |
|
WORKDIR /app |
|
|
|
ENV NODE_ENV production |
|
|
|
|
|
|
|
RUN \ |
|
addgroup --system --gid 1001 nodejs; \ |
|
adduser --system --uid 1001 nextjs |
|
|
|
COPY --from=builder --link /app/public ./public |
|
|
|
|
|
COPY --from=builder --link --chown=1001:1001 /app/.next/standalone ./ |
|
COPY --from=builder --link --chown=1001:1001 /app/.next/static ./.next/static |
|
|
|
USER nextjs |
|
|
|
EXPOSE 3000 |
|
|
|
ENV PORT 3000 |
|
ENV HOSTNAME 0.0.0.0 |
|
CMD ["bun", "run", "server.js"] |