This commit is contained in:
2026-06-10 02:16:08 -06:00
parent 4334052267
commit c3f4449296
10 changed files with 284 additions and 23 deletions
+9
View File
@@ -0,0 +1,9 @@
__pycache__
*.pyc
*.pyo
.venv
venv
.pytest_cache
.ruff_cache
.env*
Dockerfile
+8 -1
View File
@@ -2,6 +2,9 @@ FROM python:3.12-slim
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
@@ -9,4 +12,8 @@ COPY . .
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=5 \
CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8000/health').status==200 else 1)"
# --proxy-headers: necesario detrás del reverse proxy (Traefik/Coolify)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--proxy-headers", "--forwarded-allow-ips=*"]