Rust (axum) backend with git clone / zip upload / SQLite cache. Three.js frontend with D3 treemap layout and semantic zoom. Docker deployment with musl static binary.
22 lines
494 B
Docker
22 lines
494 B
Docker
# Stage 1: Build frontend
|
|
FROM node:22-slim AS frontend
|
|
WORKDIR /build
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Minimal runtime (binary built locally with musl)
|
|
FROM alpine:3.21
|
|
RUN apk add --no-cache git ca-certificates
|
|
|
|
WORKDIR /app
|
|
COPY server/target/x86_64-unknown-linux-musl/release/repo-vis-server ./
|
|
COPY --from=frontend /build/dist ./web/dist/
|
|
|
|
ENV PORT=8080
|
|
ENV FRONTEND_DIR=./web/dist
|
|
EXPOSE 8080
|
|
|
|
CMD ["./repo-vis-server"]
|