tom-hermes / Dockerfile
tkgray's picture
fix nginx temp dir perms: Dockerfile
a4462b0 verified
Raw History Blame Contribute Delete
1.9 kB
FROM nousresearch/hermes-agent:latest
# One public port (7860) fronts both surfaces:
# /v1/* -> gateway API 8642 (Open WebUI and other OpenAI clients)
# /* -> dashboard 9119 (browser UI, /api/ws, /api/pty)
# Both backends bind 0.0.0.0 so the dashboard auth gate stays engaged.
ENV HERMES_DASHBOARD=1 \
HERMES_DASHBOARD_HOST=0.0.0.0 \
HERMES_DASHBOARD_PORT=9119 \
HERMES_HOME=/opt/data \
HERMES_GATEWAY_BOOTSTRAP_STATE=running \
API_SERVER_HOST=0.0.0.0 \
API_SERVER_PORT=8642 \
HERMES_BUCKET=tkgray/hermes-data \
HERMES_SNAPSHOT=hermes-data.tgz \
SYNC_INTERVAL=900 \
PORT=7860
USER root
# uv + the two libraries the image lacks: huggingface_hub (bucket snapshots)
# and aiohttp (the port multiplexer).
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh \
&& /usr/local/bin/uv pip install --python /opt/hermes/.venv/bin/python --no-cache-dir \
"huggingface_hub>=2.4" \
&& /opt/hermes/.venv/bin/python -c "import huggingface_hub as h; print('[build] hub', h.__version__)"
# nginx fronts the single public port: it proxies websockets and Set-Cookie
# correctly by design. The hand-rolled aiohttp version kept dropping session
# cookies (dict-collapsed Set-Cookie) and killing /api/pty with 403s.
RUN apt-get update \
&& apt-get install -y --no-install-recommends nginx-light \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /var/lib/nginx/body /var/lib/nginx/proxy /var/lib/nginx/fastcgi \
&& chown -R hermes:hermes /var/lib/nginx \
&& nginx -v
RUN mkdir -p /opt/bucket /opt/data && chown -R hermes:hermes /opt/data
COPY --chmod=0755 bucket_sync.py /opt/bucket/bucket_sync.py
COPY --chmod=0644 nginx.conf /opt/bucket/nginx.conf
COPY --chmod=0755 entry.sh /opt/bucket/entry.sh
EXPOSE 7860
ENTRYPOINT ["/opt/bucket/entry.sh"]
CMD ["nginx", "-c", "/opt/bucket/nginx.conf", "-g", "daemon off;"]