mirror of
https://github.com/immich-app/immich.git
synced 2026-02-14 12:58:17 +03:00
feat: add docker healthchecks to server and ml (#9583)
* add healthcheck * format, import, IMMICH_PORT, and eslint change * chore: clean up nodejs healthcheck * fix ruff formating * add healthcheck * format, import, IMMICH_PORT, and eslint change * chore: clean up nodejs healthcheck * fix ruff formating * add healthcheck to dockerfile * poetry run ruff check --fix * removed 2 of 3 console calls --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
@@ -95,3 +95,5 @@ COPY start.sh log_conf.json ./
|
||||
COPY app .
|
||||
ENTRYPOINT ["tini", "--"]
|
||||
CMD ["./start.sh"]
|
||||
|
||||
HEALTHCHECK CMD python3 healthcheck.py
|
||||
|
||||
14
machine-learning/app/healthcheck.py
Normal file
14
machine-learning/app/healthcheck.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
import requests
|
||||
|
||||
port = os.getenv("IMMICH_PORT", 3003)
|
||||
|
||||
try:
|
||||
response = requests.get(f"http://localhost:{port}/ping", timeout=2)
|
||||
if response.status_code == 200:
|
||||
sys.exit(0)
|
||||
sys.exit(1)
|
||||
except requests.RequestException:
|
||||
sys.exit(1)
|
||||
Reference in New Issue
Block a user