Use configured PORT for Docker healthcheck
This commit is contained in:
1 parent
b5e22d424c
commit
a3956dee25
1 file changed
+1
-1
+1
-1
@@ -41,6 +41,6 @@ ENV PYTHONUNBUFFERED=1
|
||||
EXPOSE 8000
|
||||
ENV PORT=8000
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD python -c "from urllib.request import urlopen; urlopen('http://127.0.0.1:8000/health', timeout=3).close()" || exit 1
|
||||
CMD python -c "import os; from urllib.request import urlopen; urlopen('http://127.0.0.1:'+os.getenv('PORT','8000')+'/health', timeout=3).close()" || exit 1
|
||||
|
||||
CMD ["sh", "-c", "exec uvicorn main:app --app-dir src/api --host 0.0.0.0 --port ${PORT:-8000} --proxy-headers"]
|
||||
Reference in new issue
Block a user