FROM node:20-alpine
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

WORKDIR /app

COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY apps/scout-bot/package.json apps/scout-bot/

RUN pnpm install --frozen-lockfile

COPY apps/scout-bot ./apps/scout-bot

CMD ["pnpm", "--dir", "apps/scout-bot", "exec", "tsx", "src/index.ts"]
