# --- Build stage ---
FROM node:23 AS build
ENV NODE_ENV=production
ENV ORIGIN=https://praktikum.innovation-hub-niedersachsen.de
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
RUN npx prisma generate
RUN npx prisma db seed
RUN npm run build

# --- Production stage ---
FROM node:23.11-alpine3.20
COPY --from=build /app .
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["sh", "-c", "BODY_SIZE_LIMIT=500M ORIGIN=https://praktikum.innovation-hub-niedersachsen.de node build/index.js"]

