AI generated
https://github.com/nixcat-dev/adamant Dockerfile I had Claude whip up: # syntax=docker/dockerfile:1 FROM nvidia/cuda:13.0.0-devel-ubuntu24.04 AS build ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential ca-certificates cmake git python3 python3-pip python3-venv \ && rm -rf /var/lib/apt/lists/* WORKDIR /opt/app ARG APP_REF=main RUN git clone --depth 1 --branch ${APP_REF} https://github.com/<user>/<repo>.git . # docker build has no GPU, so list the archs explicitly: 86 = RTX 30, 89 = RTX 40. ARG CUDA_ARCHITECTURES="89" RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCHITECTURES}" \ && cmake --build build -j"$(nproc)" \ && test -x bin/server RUN python3 -m venv .venv \ && .venv/bin/pip install --no-cache-dir -r requirements.txt FROM nvidia/cuda:13.0.0-runtime-ubuntu24.04 ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 LANG=C.UTF-8 \ PATH=/opt/app/.venv/bin:$PATH RUN apt-get update && apt-get install -y --no-install-recommends \ curl libatomic1 libgomp1 python3 \ && rm -rf /var/lib/apt/lists/* WORKDIR /opt/app # data/ must sit beside bin/ (expert profiles); serve/ is the Python server. COPY --from=build /opt/app/bin ./bin COPY --from=build /opt/app/data ./data COPY --from=build /opt/app/serve ./serve COPY --from=build /opt/app/tools ./tools COPY --from=build /opt/app/.venv ./.venv # Models in /models, config.json in /config, engine logs and conversation cache under /root/.cache/app. VOLUME ["/models", "/config", "/root/.cache/app"] EXPOSE 8080 HEALTHCHECK --interval=30s --timeout=5s --start-period=600s --retries=3 \ CMD curl -fs http://127.0.0.1:8080/health || exit 1 ENTRYPOINT ["bin/server", "serve"] CMD ["--config", "/config/config.json"] Compose: services: app: container_name: app build: context: . dockerfile: Dockerfile args: APP_REF: main CUDA_ARCHITECTURES: "89" # 86, 89 or "86;89" image: app:local ulimits: memlock: { soft: -1, hard: -1 } # needed to pin RAM for the GPU shm_size: 2gb stop_grace_period: 2m ports: - "127.0.0.1:8083:8080" # no API key, so bind to localhost only volumes: - ./models:/models - ./config:/config:ro - ./cache:/root/.cache/app deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu] networks: - my-net restart: unless-stopped networks: my-net: external: true