FROM node:22-alpine

WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci --production=false

COPY tsconfig.json ./
COPY src/ src/

RUN npx tsc

# Clean dev deps
RUN npm prune --production

CMD ["node", "dist/index.js"]
