agenthub/deploy/Dockerfile.backend

22 lines
808 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# AgentHub hub(控制面后端)→ agenthub:latest
# build context = 仓库根目录:docker build -f deploy/Dockerfile.backend -t agenthub:latest .
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /srv/agenthub
COPY backend ./backend
RUN pip install ./backend
# 数据目录里的 agenthub.db + hub-credentials.json 需要跨重启保留
RUN useradd --system --create-home --home-dir /var/lib/agenthub agenthub
ENV AGENTHUB_DATA_DIR=/var/lib/agenthub AGENTHUB_HOST=0.0.0.0 AGENTHUB_PORT=8100
VOLUME ["/var/lib/agenthub"]
USER agenthub
EXPOSE 8100
HEALTHCHECK --interval=15s --timeout=3s --start-period=10s \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8100/healthz', timeout=2)"
CMD ["agenthub", "serve"]