FROM node:22-alpine

WORKDIR /app

COPY package.json package-lock.json tsconfig.base.json ./
COPY apps/web/package.json apps/web/package.json
COPY packages/domain/package.json packages/domain/package.json
COPY services/api/package.json services/api/package.json
RUN npm ci

COPY packages/domain packages/domain
COPY services/api services/api
RUN npm run typecheck --workspace @cents/api

EXPOSE 3000
CMD ["npm", "run", "start", "--workspace", "@cents/api"]
