This simple example starts two Python processes. One of them has a signal handler for
SIGHUP, and prints a hello when signalled. It also writes its own PID to a shared volume, for the second container to read. This one will then send the signal to this PID every second.
To deploy the stack straight from this repository:
$ curl -fsSL https://raw.githubusercontent.com/rycus86/podlike/master/examples/signal/stack.yml | docker stack deploy -c - signal
You can follow the logs with this:
$ docker service logs -f signal_pod
Or try it on the Docker Playground.