FROM node:24.10.0 AS base

RUN npm i -g bun

FROM base AS builder

WORKDIR /app

COPY package.json bun.lock turbo.json ./

COPY apps/admin/package.json ./apps/admin/package.json

COPY packages ./packages

RUN bun install

COPY apps/admin ./apps/admin

RUN bun install

RUN bun run build

COPY scripts ./scripts

EXPOSE 3000

RUN chmod +x scripts/prod.start.sh

CMD ["/bin/sh", "scripts/prod.start.sh", "apps/admin"]
