tools/app/Dockerfile
neil 9d910eb147 Tools site: Markdown editor, JSON editor, 24-hour pastebin
Single FastAPI container with a registry-driven single-page front end, so
new tools are one module plus one registry entry. Runs as one container behind a reverse proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 23:32:22 -08:00

12 lines
580 B
Docker

FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py ./
COPY tools ./tools
COPY static ./static
RUN useradd --system --uid 10001 tools && mkdir -p /data && chown tools /data
USER tools
ENV DATA_DIR=/data PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
# HOST/PORT come from compose; uvicorn trusts X-Forwarded-* only from loopback (the local proxy/tunnel).
CMD ["sh", "-c", "exec uvicorn main:app --host ${HOST:-127.0.0.1} --port ${PORT:-8090} --proxy-headers --forwarded-allow-ips 127.0.0.1 --no-server-header"]