Исправление healthcheck: добавлен API ключ в проверку здоровья

This commit is contained in:
2026-01-28 20:52:53 +03:00
parent b8915dccc2
commit 9e5173aa4a
2 changed files with 2 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ ENV LOG_LEVEL=INFO
# Порт приложения # Порт приложения
EXPOSE 8000 EXPOSE 8000
# Healthcheck # Healthcheck (будет переопределен в docker-compose.yml с API ключом)
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/health')" || exit 1 CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/health')" || exit 1

View File

@@ -32,7 +32,7 @@ services:
- RAG_AUTOSAVE_INTERVAL=${RAG_AUTOSAVE_INTERVAL:-600} - RAG_AUTOSAVE_INTERVAL=${RAG_AUTOSAVE_INTERVAL:-600}
- LOG_LEVEL=${LOG_LEVEL:-INFO} - LOG_LEVEL=${LOG_LEVEL:-INFO}
healthcheck: healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/health')"] test: ["CMD", "python", "-c", "import urllib.request, os; req = urllib.request.Request('http://localhost:8000/api/v1/health'); req.add_header('X-API-Key', os.getenv('RAG_API_KEY', '')); urllib.request.urlopen(req)"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 3 retries: 3