FROM node:22-alpine AS base
WORKDIR /app

# Install dependencies
COPY package.json package-lock.json ./
RUN npm ci --omit=dev

# Copy source
COPY src/ src/
COPY .env* ./
COPY tsconfig.json ./

# Install tsx for running TypeScript
RUN npm install -g tsx

EXPOSE 6001

CMD ["tsx", "src/index.ts"]
