FROM node:20-bookworm

WORKDIR /app

RUN npm install -g npm@10.5.0 --no-fund --no-audit
RUN corepack enable

COPY package.json package-lock.json turbo.json tsconfig.base.json ./
COPY apps ./apps
COPY packages ./packages

RUN npm ci --no-fund --no-audit

EXPOSE 3000 3001 3002 3003 4000

CMD ["sh", "-c", "npm run db:generate && npm run dev"]
