fieldwitness/docker/Dockerfile
Aaron D. Lee 5b1ac0b741 Fix Docker healthcheck hanging gunicorn workers
The healthcheck tried HTTPS first (curl -fsk https://...) when HTTPS
was disabled. The TLS ClientHello to a plain HTTP listener hung the
sync worker indefinitely. With 2 workers, both got stuck, blocking
all real HTTP requests.

Fix: try HTTP first, add --max-time 3 to release quickly on failure.
Compose override uses HTTP-only to match HTTPS_ENABLED=false default.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 19:46:04 -04:00

72 lines
2.4 KiB
Docker

# SooSeF Docker Image
#
# Requires stegasoo and verisoo source directories alongside soosef:
# Sources/
# ├── stegasoo/
# ├── verisoo/
# └── soosef/ ← build context is parent (Sources/)
#
# Build:
# docker build -t soosef -f soosef/docker/Dockerfile .
#
# Or use docker-compose from soosef/docker/:
# docker compose up
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PIP_ROOT_USER_ACTION=ignore
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
libc-dev \
libffi-dev \
libzbar0 \
libjpeg-dev \
zlib1g-dev \
curl \
openssl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# ── Install stegasoo ─────────────────────────────────────────────
COPY stegasoo/pyproject.toml stegasoo/pyproject.toml
COPY stegasoo/README.md stegasoo/README.md
COPY stegasoo/src/ stegasoo/src/
COPY stegasoo/data/ stegasoo/data/
COPY stegasoo/frontends/ stegasoo/frontends/
RUN pip install --no-cache-dir /app/stegasoo[web,dct,audio,cli]
# ── Install verisoo ──────────────────────────────────────────────
COPY verisoo/pyproject.toml verisoo/pyproject.toml
COPY verisoo/README.md verisoo/README.md
COPY verisoo/src/ verisoo/src/
RUN pip install --no-cache-dir /app/verisoo[cli]
# ── Install soosef ───────────────────────────────────────────────
COPY soosef/pyproject.toml soosef/pyproject.toml
COPY soosef/README.md soosef/README.md
COPY soosef/src/ soosef/src/
COPY soosef/frontends/ soosef/frontends/
RUN pip install --no-cache-dir /app/soosef[web,cli]
# ── Runtime setup ────────────────────────────────────────────────
RUN mkdir -p /root/.soosef
COPY soosef/docker/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
ENV SOOSEF_DATA_DIR=/root/.soosef
WORKDIR /app/soosef
EXPOSE 35811
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD curl -fs --max-time 3 http://localhost:35811/ || curl -fsk --max-time 3 https://localhost:35811/ || exit 1
ENTRYPOINT ["/app/entrypoint.sh"]