From 95ebe372df237f29cdc593eeab7695de07be3b1d Mon Sep 17 00:00:00 2001 From: seavphing Date: Wed, 16 Oct 2024 22:35:07 +0700 Subject: [PATCH] improve Dockerfile to use entrypoint in order to get better log when receive any request --- Dockerfile | 3 ++- entrypoint.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index d85d5bc..1da43d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,4 +55,5 @@ ENV PYTHONUNBUFFERED=1 # run the app (re-configure port if necessary) WORKDIR /app/deepface/api/src EXPOSE 5000 -CMD ["gunicorn", "--workers=1", "--timeout=3600", "--bind=0.0.0.0:5000", "app:create_app()"] +# CMD ["gunicorn", "--workers=1", "--timeout=3600", "--bind=0.0.0.0:5000", "app:create_app()"] +ENTRYPOINT [ "sh", "entrypoint.sh" ] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..8b3ef43 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1 @@ +gunicorn -w 1 -b 0.0.0.0:5000 --timeout 7200 --log-level 'debug' --access-logfile - --access-logformat '%(h)s - - [%(t)s] "%(r)s" %(s)s %(b)s %(L)s' app:create_app() \ No newline at end of file