forked from AlexsJones/llmfit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerAllFile
More file actions
51 lines (43 loc) · 1.47 KB
/
DockerAllFile
File metadata and controls
51 lines (43 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM node:22-bookworm AS web
WORKDIR /build/llmfit-web
COPY llmfit-web/package.json llmfit-web/package-lock.json ./
RUN npm ci
COPY llmfit-web/ ./
RUN npm run build
FROM rust:1.88-slim AS builder
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY Cargo.toml Cargo.lock ./
COPY llmfit-core ./llmfit-core
COPY llmfit-tui ./llmfit-tui
COPY llmfit-desktop ./llmfit-desktop
COPY data ./data
COPY --from=web /build/llmfit-web/dist ./llmfit-web/dist
RUN cargo build --release -p llmfit
FROM debian:bookworm-slim
# Enable Debian non-free repos so `nvidia-smi` can be installed in amd64 images.
# Runtime GPU access still requires `--gpus all` and `NVIDIA_DRIVER_CAPABILITIES`
# when starting the container.
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
pciutils \
lshw \
ca-certificates \
curl; \
sed -i -E 's/ main$/ main contrib non-free non-free-firmware/' /etc/apt/sources.list; \
apt-get update; \
if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
apt-get install -y --no-install-recommends nvidia-smi; \
fi; \
(update-pciids || true); \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/target/release/llmfit /usr/local/bin/llmfit
RUN useradd -m -u 1000 llmfit && \
chown llmfit:llmfit /usr/local/bin/llmfit
USER llmfit
ENTRYPOINT ["/usr/local/bin/llmfit"]
CMD ["serve", "--host", "0.0.0.0", "--port", "8787"]