FROM oven/bun:1-slim AS build ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /src ARG LUMIVERSE_REPO=https://github.com/CloudCompile/Lumiverse.git ARG LUMIVERSE_REF=main RUN git clone --depth 1 --branch "${LUMIVERSE_REF}" "${LUMIVERSE_REPO}" . # Prevent bun from trying to migrate npm lockfiles during install RUN rm -f package-lock.json npm-shrinkwrap.json yarn.lock pnpm-lock.yaml # Backend deps (allow bun.lock* generation/updates inside the container build) RUN bun install --production 2>/dev/null || bun install --production # Frontend build WORKDIR /src/frontend RUN rm -f package-lock.json npm-shrinkwrap.json yarn.lock pnpm-lock.yaml RUN bun install 2>/dev/null || bun install RUN bun run build FROM oven/bun:1-slim ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \ && update-ca-certificates \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=build /src/node_modules ./node_modules COPY --from=build /src/package.json ./package.json COPY --from=build /src/src ./src COPY --from=build /src/frontend/dist ./frontend/dist RUN mkdir -p /data && chown -R bun:bun /data ENV NODE_ENV=production ENV PORT=7860 ENV DATA_DIR=/data ENV FRONTEND_DIR=/app/frontend/dist ENV TRUST_ANY_ORIGIN=true ENV OWNER_PASSWORD=changeme123 ENV OWNER_USERNAME=admin EXPOSE 7860 VOLUME /data USER bun CMD ["bun", "run", "src/index.ts"]