FROM oven/bun

ARG BACKEND_URL

WORKDIR /app

COPY . .

RUN bun install

WORKDIR packages/frontend

RUN bun run build

ENV HOST=0.0.0.0
ENV PORT=4321
ENV BACKEND_URL=${BACKEND_URL}

EXPOSE 4321

RUN mkdir -p /app/logs

CMD ["bun", "/app/packages/frontend/dist/server/entry.mjs"]
