add healthcheck endpoint & dockerignore

This commit is contained in:
austnv
2026-06-14 16:07:28 +03:00
parent fc79923e0e
commit e43b417e6f
3 changed files with 15 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
.venv
__pycache__
*.pyc
.git
.env
+6
View File
@@ -18,6 +18,12 @@ services:
networks: networks:
- remnawave-network - remnawave-network
restart: unless-stopped restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health', timeout=3).read()"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks: networks:
remnawave-network: remnawave-network:
+4
View File
@@ -14,4 +14,8 @@ app = FastAPI(
version=get_version_from_pyproject() version=get_version_from_pyproject()
) )
@app.get("/api/health")
async def health_check():
return {"status": "healthy", "service": "uvpn-backend"}
app.include_router(ip.router) app.include_router(ip.router)