title: docker-compose redis password via environment variable
body: <p>I'm trying to pass my redis password to <code>docker-compose</code> via environment variable but it gives me an errors.</p>
  <p>Here is mine part of mine docker-compose with redis image:</p>
  <pre><code>  redis:
      image: redis
      container_name: redis
      # command: redis-server --requirepass mypassword &lt;--- this works as expected
      # command: redis-server --requirepass ${REDIS_PASSWORD} &lt;-- this is not
      command: redis-server --requirepass $${REDIS_PASSWORD} &lt;-- and this is not
      volumes:
        - redis:/var/lib/redis/data
        - ./redis.conf:/usr/local/etc/redis/redis.conf
      ports:
        - &quot;6379&quot;
      env_file:
        - .env.prod
  </code></pre>
  <p>My <code>.env.prod</code></p>
  <pre><code>REDIS_PASSWORD=mypassword
  </code></pre>
  <p>It gives me an error:</p>
  <pre><code>consumer: Cannot connect to redis://:**@redis:6379/0: WRONGPASS invalid username-password pair or user is disabled..
  </code></pre>
  <p>But if I specifying password directly in docker-compose without env variable it works.</p>