Spaces:
Runtime error
Runtime error
File size: 1,012 Bytes
ad79323 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | FROM node:22-alpine AS base
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
FROM base AS deps
RUN apk add --no-cache libc6-compat openssl
ENV DATABASE_URL=postgresql://courtrix:courtrix@postgres:5432/courtrix?schema=public
COPY package.json package-lock.json ./
COPY prisma ./prisma
RUN npm ci
FROM base AS builder
RUN apk add --no-cache libc6-compat openssl
ENV DATABASE_URL=postgresql://courtrix:courtrix@postgres:5432/courtrix?schema=public
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
FROM base AS runner
RUN apk add --no-cache libc6-compat openssl
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/next.config.ts ./next.config.ts
COPY --from=builder /app/prisma ./prisma
EXPOSE 3000
CMD sh -c "npm run db:migrate:deploy || echo 'Migration failed' ; npm start"
|