mirror of
https://github.com/bilde2910/Hauk.git
synced 2026-07-17 16:37:49 +00:00
SIGTERM handling by docker container
This commit is contained in:
parent
9deab20a55
commit
fd7bc44d61
2 changed files with 27 additions and 3 deletions
|
|
@ -11,4 +11,6 @@ RUN apt-get update && \
|
|||
EXPOSE 80/tcp
|
||||
VOLUME /etc/hauk
|
||||
|
||||
CMD ["/bin/sh", "start.sh"]
|
||||
STOPSIGNAL SIGINT
|
||||
RUN chmod +x ./start.sh
|
||||
CMD ["./start.sh"]
|
||||
|
|
|
|||
|
|
@ -1,3 +1,25 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
stop_all()
|
||||
{
|
||||
echo "Stopping apache"
|
||||
kill $APACHE_PID
|
||||
|
||||
echo "Stopping memcached"
|
||||
kill $MEMCACHED_PID
|
||||
}
|
||||
|
||||
trap stop_all INT TERM
|
||||
|
||||
memcached -u memcache &
|
||||
apachectl -D FOREGROUND
|
||||
MEMCACHED_PID=$!
|
||||
|
||||
apachectl -D FOREGROUND &
|
||||
APACHE_PID=$!
|
||||
|
||||
echo "Started"
|
||||
wait $APACHE_PID $MEMCACHED_PID
|
||||
trap - TERM INT
|
||||
wait $APACHE_PID $MEMCACHED_PID
|
||||
|
||||
echo "Done"
|
||||
Loading…
Add table
Add a link
Reference in a new issue