thox-mesh-controller / Dockerfile
tommytracx's picture
THOX mesh controller: registry + router for ephemeral nodes
f0871a5 verified
Raw
History Blame Contribute Delete
972 Bytes
# ThoxRoute Mesh Controller — always-on HF Space (free CPU tier)
# Runs the mesh registry + FastAPI proxy. The ThoxRoute-1.5B classifier
# runs as an Ollama sidecar in the background (best-effort — the API
# starts immediately and degrades gracefully if the classifier isn't ready).
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1 \
THOXROUTE_PORT=7860
WORKDIR /app
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Python deps
COPY requirements.txt ./
RUN pip install --upgrade pip && pip install -r requirements.txt
# App code
COPY mesh.py app.py ./
# User setup (HF Spaces requires non-root)
RUN useradd -m -u 10001 thox \
&& mkdir -p /app/models /tmp \
&& chown -R thox:thox /app
USER thox
EXPOSE 7860
# Simple startup — just run the FastAPI app directly.
# The classifier sidecar (Ollama) is optional and can be added later.
CMD ["python", "app.py"]