title: Running Redis on ECS using Fargate
body: <p>In my application, I have use ruby and rails application. The application runs on ngix+passanger. I have also used Redis and sidekiq. I want to run my application on ECS Fargate.</p>
  <p><strong>I have implemented the below steps:</strong></p>
  <ol>
  <li>Created Docker image using docker file</li>
  </ol>
  <ul>
  <li>web</li>
  <li>webServer</li>
  <li>Redis</li>
  <li>Sidekiq</li>
  </ul>
  <ol start="2">
  <li>Push docker image into ECR</li>
  <li>Create task using Fargate</li>
  <li>run task on ECS with Fargate</li>
  </ol>
  <p>My docker-compose file is as below:</p>
  <pre><code>version: '3.7' 
  
  services:
    web:
      build: 
          context: .
          dockerfile: ./Dockerfile
      ports : 
        -  3000:3000 
      env_file:
        - .env
  
    webserver:
      build : 
        context: .      
        dockerfile: ./nginx/Dockerfile 
      links: 
        - 'web'
      ports : 
        -  80:80 
      env_file:
        - .env
  
    redis:
      build : 
        context: .
        dockerfile: ./redis/Dockerfile 
      volumes:
        - ../../tmp/db:/var/lib/redis/data
      ports:
        - '6379:6379'
  
    sidekiq:
      build: .
      command: 'bundle exec sidekiq'    
  </code></pre>
  <p>While I run the task then I got error like as below:<br></p>
  <p><strong>Error</strong>
  <a href="https://i.stack.imgur.com/4x4MV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4x4MV.png" alt="enter image description here" /></a></p>