- 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>
37 lines
987 B
Docker
37 lines
987 B
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
FROM python:3.11-slim AS base
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
|
|
WORKDIR /app
|
|
|
|
# Dependencias del sistema (Presidio necesita libpangocairo / spacy modelos)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY core/requirements.txt /app/requirements.txt
|
|
RUN pip install -r /app/requirements.txt
|
|
|
|
# Modelo de spaCy requerido por Presidio (en idioma `en`)
|
|
RUN python -m spacy download en_core_web_sm
|
|
|
|
COPY core/src /app/src
|
|
ENV PYTHONPATH=/app/src
|
|
|
|
# Usuario no-root
|
|
RUN useradd --create-home --shell /bin/bash agent && chown -R agent:agent /app
|
|
USER agent
|
|
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=10s --timeout=3s --start-period=15s --retries=3 \
|
|
CMD curl -fsS http://localhost:8000/health || exit 1
|
|
|
|
CMD ["uvicorn", "agentforge_core.main:app", "--host", "0.0.0.0", "--port", "8000"]
|