Repository navigation
Expand file tree
/
Copy pathDockerfile.deploy
More file actions
66 lines (52 loc) · 2.34 KB
/
Copy pathDockerfile.deploy
File metadata and controls
66 lines (52 loc) · 2.34 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Fast deployment Dockerfile — uses pre-built local artifacts.
# Skips LibTorch compilation (uses the binary already built on the host).
#
# Build: docker build -f Dockerfile.deploy -t radsilent/vectormbe:latest .
# Push: docker push radsilent/vectormbe:latest
#
# Requirements before running this build:
# 1. cargo build --release -p vectormbed (done — binary at target/release/vectormbed)
# 2. cd ui && npm run build (done — dist at ui/dist)
# 3. Gather LibTorch .so files into libtorch-lib/ (see scripts/prepare-docker-context.sh)
FROM debian:trixie-slim
# Command-line tools the server shells out to. These are runtime dependencies of
# API endpoints, not build tooling, so dropping one turns into a 400 at the edge
# rather than a build failure:
# poppler-utils -> pdftotext, for PDF spec import
# git -> /vc/push runs git init/add/commit/push in a work dir; without
# it the endpoint fails with
# "git init: exec error: No such file or directory (os error 2)"
# ca-certificates -> TLS trust store, so git can verify github.com on push
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
gnupg \
libgomp1 \
poppler-utils \
&& rm -rf /var/lib/apt/lists/*
# Install Caddy
RUN curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg && \
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list && \
apt-get update && apt-get install -y --no-install-recommends caddy && rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN useradd -m -u 1000 vectormbe
# Pre-built binary
COPY target/release/vectormbed /usr/local/bin/vectormbed
# LibTorch shared libraries (needed at runtime)
COPY libtorch-lib /usr/local/libtorch/libtorch/lib/
# Built UI
COPY ui/dist ./ui-dist
# Server config + entrypoint
COPY Caddyfile.container ./Caddyfile
COPY docker-entrypoint.sh ./
COPY data ./data
RUN chown -R vectormbe:vectormbe /app && chmod +x /app/docker-entrypoint.sh
USER vectormbe
ENV VECTORMBE_HOST=127.0.0.1
ENV VECTORMBE_PORT=18080
ENV VECTORMBE_REQUIRE_TORCH_GPU=false
ENV RUST_LOG=info
ENV LD_LIBRARY_PATH=/usr/local/libtorch/libtorch/lib
EXPOSE 8080
ENTRYPOINT ["/app/docker-entrypoint.sh"]