From 8e325e6cde1e033f5677b8fcb0ebfb4322662888 Mon Sep 17 00:00:00 2001 From: isummer Date: Wed, 12 Oct 2022 15:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=B9=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=81=9C=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/Dockerfile | 3 ++- fir_ser/entrypoint.sh | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 fir_ser/entrypoint.sh diff --git a/fir_ser/Dockerfile b/fir_ser/Dockerfile index ea4a5f0..a4bd4bd 100644 --- a/fir_ser/Dockerfile +++ b/fir_ser/Dockerfile @@ -36,5 +36,6 @@ RUN addgroup --system --gid 101 nginx \ #EXPOSE 443 #ENTRYPOINT ["./entrypoint.sh"] #ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "-n"] -CMD ["python", "manage.py", "start", "all","-u","nginx","-usm","1"] +#CMD ["python", "manage.py", "start", "all","-u","nginx","-usm","1"] +ENTRYPOINT ["/bin/bash", "entrypoint.sh"] diff --git a/fir_ser/entrypoint.sh b/fir_ser/entrypoint.sh new file mode 100644 index 0000000..a612ab8 --- /dev/null +++ b/fir_ser/entrypoint.sh @@ -0,0 +1,22 @@ +#!/bin/bash +function cleanup() +{ + local pids=`jobs -p` + if [[ "${pids}" != "" ]]; then + kill ${pids} >/dev/null 2>/dev/null + fi +} + +action="${1-start}" +service="${2-all}" + +trap cleanup EXIT + +rm -f logs/tmp/*.pid + +if [[ "$action" == "bash" || "$action" == "sh" ]];then + bash +else + python manage.py "${action}" "${service}" -u nginx -usm 1 +fi +