1339f42e69
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
936 B
Docker
32 lines
936 B
Docker
FROM node:20-alpine AS deps
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
RUN npx prisma generate
|
|
RUN npm run build
|
|
|
|
FROM node:20-alpine 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
|
|
COPY --from=builder /app/prisma ./prisma
|
|
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
|
|
COPY --from=builder /app/entrypoint.sh ./entrypoint.sh
|
|
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
|
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
|
|
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
|
|
COPY --from=builder /app/node_modules/.bin/prisma ./node_modules/.bin/prisma
|
|
|
|
RUN chmod +x entrypoint.sh
|
|
|
|
EXPOSE 3000
|
|
CMD ["sh", "entrypoint.sh"]
|