28 lines
653 B
Docker
28 lines
653 B
Docker
FROM node:20-alpine AS base
|
|
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
|
|
|
FROM base AS deps
|
|
WORKDIR /app
|
|
COPY package.json pnpm-lock.yaml ./
|
|
RUN apk add --no-cache libc6-compat && \
|
|
corepack enable pnpm && \
|
|
pnpm install --frozen-lockfile
|
|
|
|
FROM base AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
RUN corepack enable pnpm && \
|
|
pnpm run build
|
|
|
|
FROM base AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/.next/standalone ./
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
EXPOSE 3000
|
|
ENV HOSTNAME=0.0.0.0
|
|
ENV PORT=3000
|
|
CMD ["node", "server.js"]
|