Add Docker healthcheck blocks so Nomad check stanzas map 1:1 at migration: - agents / agents-llama: pgrep -f entrypoint.sh (60s interval) - woodpecker-agent: wget healthz on :3333 (30s interval) - edge: curl Caddy admin API on :2019 (30s interval) - staging: wget Caddy admin API on :2019 (30s interval) - chat: add /health endpoint to server.py (no-auth 200 OK), fix Dockerfile HEALTHCHECK to use it, add compose-level healthcheck Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
35 lines
1.1 KiB
Docker
35 lines
1.1 KiB
Docker
# disinto-chat — minimal HTTP backend for Claude chat UI
|
|
#
|
|
# Small Debian slim base with Python runtime.
|
|
# Chosen for simplicity and small image size (~100MB).
|
|
#
|
|
# Image size: ~100MB (well under the 200MB ceiling)
|
|
#
|
|
# The claude binary is mounted from the host at runtime via docker-compose,
|
|
# not baked into the image — same pattern as the agents container.
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
# Install Python (no build-time network access needed)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
python3 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Non-root user — fixed UID 10001 for sandbox hardening (#706)
|
|
RUN useradd -m -u 10001 -s /bin/bash chat
|
|
|
|
# Copy application files
|
|
COPY server.py /usr/local/bin/server.py
|
|
COPY entrypoint-chat.sh /entrypoint-chat.sh
|
|
COPY ui/ /var/chat/ui/
|
|
|
|
RUN chmod +x /entrypoint-chat.sh /usr/local/bin/server.py
|
|
|
|
USER chat
|
|
WORKDIR /var/chat
|
|
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')" || exit 1
|
|
|
|
ENTRYPOINT ["/entrypoint-chat.sh"]
|