state-hub/Dockerfile
tegwick 16201ac918
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 2m3s
feat(deploy): railiance01 consistency sweep host mount and hostname override
Add git/ssh to the runtime image, mount /home/tegwick into the state-hub pod,
resolve host_paths via STATE_HUB_SWEEP_HOSTNAME, and fall back to the
railiance01 the-custodian canon path for classification validation.
2026-07-06 19:24:28 +02:00

48 lines
1.8 KiB
Docker

FROM python:3.12-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="/app/.venv/bin:${PATH}"
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates git openssh-client \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --no-cache-dir uv
COPY pyproject.toml ./
# Bump DEPS_LOCK_ID when dependency wiring changes (busts DinD layer cache).
ARG DEPS_LOCK_ID=5
RUN echo "deps-lock=${DEPS_LOCK_ID}" \
&& python -c "import tomllib,sys; from pathlib import Path; project=tomllib.load(open('pyproject.toml','rb'))['project']; deps=[d for d in (project.get('dependencies') or []) if d not in {'llm-connect','hub-core'}]; \
sys.exit('no installable dependencies') if not deps else None; Path('/app/requirements.txt').write_text('\\n'.join(deps)+'\\n'); print(f'wrote {len(deps)} requirements')" \
&& test -s /app/requirements.txt \
&& uv venv /app/.venv \
&& uv pip install --python /app/.venv/bin/python --no-cache -r /app/requirements.txt
COPY --from=hub_core_src pyproject.toml /tmp/hub-core/pyproject.toml
COPY --from=hub_core_src hub_core/ /tmp/hub-core/hub_core/
RUN uv pip install --python /app/.venv/bin/python --no-cache /tmp/hub-core
RUN test -s /app/requirements.txt \
&& /app/.venv/bin/python -c "import asyncpg"
COPY alembic.ini ./
COPY api/ ./api/
COPY flows/ ./flows/
COPY mcp_server/ ./mcp_server/
COPY migrations/ ./migrations/
COPY policies/ ./policies/
COPY prompts/ ./prompts/
COPY scripts/ ./scripts/
COPY task_flow_engine/ ./task_flow_engine/
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/state/health', timeout=3).read()"
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]