remove separate ui service, serve ui with backend
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 10s

This commit is contained in:
2025-07-18 01:54:26 +01:00
parent f9047644fe
commit a54648d11b
69 changed files with 145 additions and 11214 deletions

42
Dockerfile Normal file
View File

@ -0,0 +1,42 @@
FROM node:24-alpine AS node-builder
WORKDIR /app
COPY ui/package-lock.json .
COPY ui/package.json .
RUN npm install
COPY ui .
RUN npm run build
FROM rust:1.87 AS base
RUN cargo install --locked cargo-chef sccache
ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
FROM base AS planner
WORKDIR /app
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM base AS builder
WORKDIR /app
COPY --from=planner /app/recipe.json recipe.json
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo build --release --bin nuchat --target-dir=/app/target
FROM gcr.io/distroless/cc AS runtime
WORKDIR /app
ADD --chmod=a+x vendor/busybox_WGET /usr/bin/wget
COPY --from=node-builder /app/dist dist
COPY --from=builder /app/target/release/nuchat .
# HEALTHCHECK --interval=5s --retries=1 --timeout=5s CMD ["wget", "-q", "--spider", "http://localhost:7000/healthcheck
ENTRYPOINT [ "/app/nuchat", "--host", "0.0.0.0" ]