FROM oven/bun:1

WORKDIR /app

# Install dependencies first (cached layer)
COPY package.json bun.lock ./
COPY packages/shared/package.json packages/shared/
COPY packages/backend/package.json packages/backend/
RUN bun install --frozen-lockfile

# Copy source
COPY . .

WORKDIR /app/packages/backend

EXPOSE 8000

CMD ["bun", "--watch", "run", "src/main.ts"]
