specify sysctl values using docker-compose
<p>I am trying to set a few sysctl values.<br>
Basically the following </p>

<pre><code>sysctl -w \
   net.ipv4.tcp_keepalive_time=300 \
   net.ipv4.tcp_keepalive_intvl=60 \
   net.ipv4.tcp_keepalive_probes=9
</code></pre>

<p>in a docker container.<br>
When log into to the container directly and execute the command, I get the following error</p>

<pre><code>sysctl: cannot stat /proc/sys/net/ipv4/tcp_keepalive_time: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv4/tcp_keepalive_intvl: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv4/tcp_keepalive_probes: No such file or directory
</code></pre>

<p>Then I found out the --sysctl option in <code>docker run</code> in <a href="https://docs.docker.com/engine/reference/commandline/run/" rel="noreferrer">here</a>
But I did not find the equivalent option via docker-compose. 
I have few services that start by default so using docker run instead of docker-compose is not an option for me.</p>

<p>Anyone knows of a way to supply --sysctl options to the container via compose?</p>