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 +