title: 127.0.0.1 with docker-compose
body: <p>I have a project and I have to use 127.0.0.1 to connect redis to flask but I can't seem to link it with this IP address.
  Here is my docker-compose.yml, as well as my flask.</p>
  <pre><code>version: &quot;3.0&quot;
  services:
    poll:
      container_name: poll
      build: ./poll
      environment:
        - FLASK_APP=app.py
      ports:
        - 5000:80
      networks:
        - poll-tier
  
    redis:
      container_name: redis
      image: redis
      ports:
        - 6379:6379
      networks:
        - poll-tier
  
  networks:
    poll-tier: {}
  </code></pre>
  <p>And my flask (I don't have the right to modify it in my project) :</p>
  <pre><code>app = Flask(__name__)
  
  
  def get_redis():
      if not hasattr(g, 'redis'):
          g.redis = Redis(host=&quot;127.0.0.1&quot;, db=0, socket_timeout=5)
      return g.redis
  
  
  </code></pre>
  <p>If you have a solution i'm okay</p>