So I have four servers that run an instance of a Docker image on each of them. I have been asked to deploy a Memcache image, link it to the instances by adding it inside the docker-compose.yml file, and to make sure that the Memcache container does not accept connections from outside.
Basically, my docker-compose.yml looks like so:
“` version: '2'
services: web: depends_on: – mysql ports: – 8080:80`
mysql: image: mysql:5.7 ports: – 3306:3306`
memcached: image: memcached depends_on: – web
How can I make sure that when running
telnet 172.18.0.2:11211 from outside the containers, I will get a
connection refused but not when running
telnet memcached:11211 from inside the
Thank you in advance.