<p>I want to have 50 instance of redis, can I achieve this using docker-compose ? or should I use Kuberneties instead ? the point here is I want each instance has its own port and its own volume.</p>

<p>another question is how I can distribute the instances between multiple hosts, for example each 10 container will be host it on different server. (docker-swarm or Kuberneties ?)</p>

Moss
<p>Kubernetes would fit your use case. I would use the Helm chart from the stable:</p>

<p><a href="https://hub.helm.sh/charts/bitnami/redis/6.4.0" rel="nofollow noreferrer">https://hub.helm.sh/charts/bitnami/redis/6.4.0</a></p>

<p>Invest some time in the kubernetes as then you get so much for free. Redis would be a Statefulset in Kubernetes and you can scale it as you like if you have the resources.
In many cloud providers Redis should be an out of the box Application:</p>

<p>A statefulset garantees that each instance uses its own data volume.</p>

<p><a href="https://www.digitalocean.com/docs/databases/redis/how-to/create/" rel="nofollow noreferrer">https://www.digitalocean.com/docs/databases/redis/how-to/create/</a></p>

<p>Have fun!</p>
