2026-06-14 15:36:44 +02:00
|
|
|
FROM node:22-alpine AS base
|
|
|
|
|
RUN corepack enable && corepack prepare pnpm@10.28.0 --activate
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
FROM base AS deps
|
|
|
|
|
COPY package.json pnpm-lock.yaml .npmrc ./
|
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
|
|
FROM base AS builder
|
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
|
|
|
COPY . .
|
|
|
|
|
RUN pnpm build
|
|
|
|
|
|
|
|
|
|
FROM base AS runner
|
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
|
|
|
|
|
COPY --from=builder /app/public ./public
|
|
|
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
|
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
|
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
|
COPY --from=builder /app/scripts ./scripts
|
|
|
|
|
COPY --from=builder /app/lib ./lib
|
|
|
|
|
COPY --from=builder /app/package.json ./package.json
|
|
|
|
|
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
2026-06-14 18:43:43 +02:00
|
|
|
COPY --from=builder /app/app/data ./app/data
|
2026-06-14 15:36:44 +02:00
|
|
|
USER nextjs
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
ENV PORT=3000 HOSTNAME="0.0.0.0"
|
2026-06-14 18:43:43 +02:00
|
|
|
CMD ["sh", "-c", "node_modules/.bin/tsx scripts/seed.ts && node server.js"]
|