Skip to content

Commit

Permalink
health
Browse files Browse the repository at this point in the history
  • Loading branch information
all-mute committed Sep 28, 2024
1 parent 60d7e9c commit fa3633e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ EXPOSE 8000
ENV FOLDER_ID=""
ENV YANDEX_API_KEY=""

# Добавляем healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl --fail http://localhost:8000/health || exit 1

# Команда для запуска приложения
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
8 changes: 7 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ services:
build: .
ports:
- "127.0.0.1:8000:8000"
restart: unless-stopped
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "--fail", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s

0 comments on commit fa3633e

Please sign in to comment.