Container exits if invoked from compose

I have a dockerized server process that merely listens on a port 5000
[admin@gol05854 compose]$ cat …/proc1/server.sh
#!/bin/sh

echo `date` "Starting server"

nc -v -l -p 5000

echo `date` "Exiting server"

I have a client that is expected to continuously send messages to the server:
[admin@gol05854 compose]$ cat …/client/client.sh
#!/bin/sh

echo `date` "Starting client"

while true
do
date
done | nc my_server 5000

echo `date` "Ending client"

I start these together using compose. However, the server
[admin@gol05854 compose]$ docker logs e1_my_server_1
Wed Oct 26 04:10:34 UTC 2016 Starting server
listening on [::]:5000 …
connect to [::ffff:172.27.0.2]:5000 from e1_my_client_1_1.e1_default:36500 ([::ffff:172.27.0.3]:36500)
Wed Oct 26 04:10:36 UTC 2016
Wed Oct 26 04:10:36 UTC 2016
Wed Oct 26 04:10:36 UTC 2016
Wed Oct 26 04:10:36 UTC 2016
Wed Oct 26 04:10:36 UTC 2016 Exiting server

What is surprising is that if the same containers are started without compose, using docker run, the server remains running.

What is it that docker compose does that causes the server to exit after receiving a few messages?

The code can be found at https://github.com/yashgt/dockerpoc