FROM oven/bun:1.3.2

WORKDIR /app

ENV NODE_ENV=production
ENV PORT=3000
ENV BMP_DATA_DIR=/data

COPY package.json bun.lock ./
COPY packages/extractor/package.json packages/extractor/package.json
COPY packages/summarizer/package.json packages/summarizer/package.json
COPY packages/templatebuilder/package.json packages/templatebuilder/package.json

RUN bun install --frozen-lockfile
RUN bun run playwright:install-deps && bun run playwright:install

COPY . .

RUN mkdir -p /data/extractor/outputs /data/summarizer/outputs /data/templatebuilder

EXPOSE 3000

CMD ["bun", "run", "start"]
