# syntax=docker/dockerfile:1.7
FROM node:22-slim

RUN corepack enable && corepack prepare pnpm@11.24.0 --activate

WORKDIR /repo

COPY pnpm-workspace.yaml package.json pnpm-lock.yaml tsconfig.base.json ./
COPY packages/types packages/types
COPY packages/shared packages/shared
COPY apps/freeswitch-config apps/freeswitch-config

RUN pnpm install --frozen-lockfile --filter @b2bcall/freeswitch-config...

WORKDIR /repo/apps/freeswitch-config

CMD ["pnpm", "exec", "tsx", "src/main.ts"]
