Skip to content

feat: Dockerfile (multi-stage build with baked-in model) #97

Description

@ajianaz

Summary

Create Dockerfile for uteke-serve with multi-stage build, pre-built binary from release, and embedding model baked in.

Acceptance Criteria

  • Multi-stage build (build deps in stage 1, runtime only in stage 2)
  • Downloads pre-built binary from GitHub release (not cargo build)
  • Embedding model baked into image (no runtime download)
  • ENV UTEKE_HOME=/data for configurable data directory
  • EXPOSE 8767 with CMD uteke-serve (uses defaults from feat: uteke-serve reads uteke.toml config, default host 0.0.0.0 #96)
  • .dockerignore excludes .git, target/, node_modules/, website/
  • Image works with both volume mount and bind mount
  • Total image size < 300MB

Design

Stage 1 (builder): debian:bookworm-slim
  - curl release binary (uteke + uteke-serve)
  - curl model files from HuggingFace (3 files ~188MB)

Stage 2 (runtime): debian:bookworm-slim
  - COPY --from=builder binaries to /usr/local/bin/
  - COPY --from=builder model to $UTEKE_HOME/models/
  - ENV UTEKE_HOME=/data
  - EXPOSE 8767
  - ENTRYPOINT ["uteke-serve"]

Usage

docker build -t uteke:v0.0.5 .

# Run with volume
docker run -d -p 8767:8767 -v uteke-data:/data uteke:v0.0.5

# Verify
curl http://localhost:8767/health
curl -X POST http://localhost:8767/remember -d '{"content":"hello","tags":["test"]}'
curl -X POST http://localhost:8767/recall -d '{"query":"hello"}'

Depends On

Verification

docker build -t uteke:test .                          # build succeeds
docker run --rm -p 8767:8767 uteke:test                # binds 0.0.0.0:8767
curl localhost:8767/health                             # {"status":"ok"}
docker run --rm uteke:test du -sh /data/models          # model exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions