Files
lune/Dockerfile
2026-10-29 12:46:33 +07:00

27 lines
992 B
Docker

# Lune hub: one container, data on /data. The web canvas is built first and embedded in the binary.
FROM node:22-bookworm-slim AS web
WORKDIR /web
COPY web/package.json web/package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY web/ ./
RUN npm run build
FROM rust:1.99-bookworm AS build
WORKDIR /src
COPY . .
COPY --from=web /web/dist ./web/dist
# On a small server: docker build --build-arg CARGO_BUILD_JOBS=2 . (unset means one job per core)
ARG CARGO_BUILD_JOBS
RUN cargo build --release -p lunehub
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/* \
&& useradd --system --uid 1000 --home /data lune && mkdir /data && chown lune /data
COPY --from=build /src/target/release/lunehub /usr/local/bin/lunehub
USER lune
ENV LUNE_HUB_DATA=/data LUNE_HUB_LISTEN=0.0.0.0:8080
VOLUME /data
EXPOSE 8080
HEALTHCHECK --interval=30s --start-period=5s CMD ["lunehub", "health"]
CMD ["lunehub", "serve"]