Dockerfile will kill the process if stuck so that restart policy can restart the container
Gunicorn will kill worker every 10000 requests which can help reclaim memory lost to leaks
This commit is contained in:
@ -54,7 +54,8 @@ RUN chmod 777 /app/docker-entrypoint.sh \
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
# at the end of your Dockerfile, before CMD or after EXPOSE
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD curl -f http://localhost/health || exit 1
|
||||
# Kill the main process if the healthcheck fails. This will kill the container and restart policy can restart it.
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD curl -f http://localhost/health || kill -s 15 1
|
||||
|
||||
CMD ["poetry", "run", "/app/run.sh"]
|
||||
|
||||
Reference in New Issue
Block a user