优化容器启停异常

pull/26/merge
isummer 2 years ago
parent 92961cfa61
commit 8e325e6cde
  1. 3
      fir_ser/Dockerfile
  2. 22
      fir_ser/entrypoint.sh

@ -36,5 +36,6 @@ RUN addgroup --system --gid 101 nginx \
#EXPOSE 443 #EXPOSE 443
#ENTRYPOINT ["./entrypoint.sh"] #ENTRYPOINT ["./entrypoint.sh"]
#ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "-n"] #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"]

@ -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
Loading…
Cancel
Save