build: añade Dockerfiles para core y dashboard con healthchecks y usuario no-root

- core/Dockerfile: python:3.11-slim, instala requirements + modelo spaCy
  (en_core_web_sm para Presidio), corre como usuario `agent`, HEALTHCHECK sobre
  /health, CMD uvicorn :8000.
- dashboard/Dockerfile: python:3.11-slim, usuario `dash`, HEALTHCHECK sobre
  /_stcore/health, CMD streamlit :8501 headless.
- .dockerignore: excluye venv, caches, datos runtime, .env, specs/plans y tests.

Ambos pasan `docker build --check` sin warnings.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Juan
2026-05-11 12:58:51 +02:00
co-authored by Claude Opus 4.7
parent a874d9f57d
commit 33bc9ed133
3 changed files with 81 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
# syntax=docker/dockerfile:1.7
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY dashboard/requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt
COPY dashboard/src /app/src
ENV PYTHONPATH=/app/src
RUN useradd --create-home --shell /bin/bash dash && chown -R dash:dash /app
USER dash
EXPOSE 8501
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=3 \
CMD curl -fsS http://localhost:8501/_stcore/health || exit 1
CMD ["streamlit", "run", "/app/src/agentforge_dashboard/app.py", \
"--server.address=0.0.0.0", "--server.port=8501", \
"--server.headless=true", "--browser.gatherUsageStats=false"]