title: Not possible to connect to Redis
body: <p>I have been stuck on this very issue for nearly 2 days. It crashes when it tries to connect (shown in code below). I am getting an exception that says :</p>
  <blockquote>
  <p>StackExchange.Redis.RedisConnectionException: 'It was not possible to
  connect to the redis server(s). UnableToConnect on
  127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 0s ago,
  last-write: 0s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10
  available, last-heartbeat: never, global: 5s ago, v: 2.1.30.38891'</p>
  </blockquote>
  <p><strong>The code is in the StartUp file.</strong></p>
  <pre><code>            services.AddSingleton&lt;ConnectionMultiplexer&gt;(c =&gt;
          {
              var configuration = ConfigurationOptions.Parse(Configuration.GetConnectionString(&quot;Redis&quot;));
  
              return ConnectionMultiplexer.Connect(configuration);
          });
  </code></pre>
  <p>UPDATE</p>
  <p><a href="https://i.stack.imgur.com/FJjcW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FJjcW.png" alt="enter image description here" /></a></p>
  <p>DOCKER COMPOSE</p>
  <p>ersion: '3.4'</p>
  <pre><code>services:
    authdb:
      image: redis  
    authentication.api:
      image: ${DOCKER_REGISTRY-}authenticationapi
      build:
        context: .
        dockerfile: Authentication.API/Dockerfile
  </code></pre>
  <p>DOCKER COMPOSE OVERRIDE</p>
  <p>version: '3.4'</p>
  <pre><code>services:
    authdb:
      container_name: authdb
      restart: always
      ports:
        - &quot;6379:6379&quot;
    authentication.api:
      environment:
        - ASPNETCORE_ENVIRONMENT=Development
        - &quot;ConnectionStrings:Redis=authdb:6379&quot;
        - ASPNETCORE_URLS=https://+:443;http://+:80
      ports:
        - &quot;80&quot;
        - &quot;443&quot;
      volumes:
        - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro
  </code></pre>