title: Why does Docker container keeps restarting? ERROR: getaddrinfo EAI_AGAIN
body: <p>This is my docker-compose.yml file</p>
  <pre><code>version: &quot;3&quot;
  services:
  
    outline:
      image: outlinewiki/outline:latest
      restart: always
      command: sh -c &quot;yarn sequelize:migrate --env=production-ssl-disabled &amp;&amp; yarn start --env=production-ssl-disabled&quot;
      env_file: ./docker.env
      ports:
        - &quot;3000:3000&quot;
      depends_on:
        - postgres
        - redis
  
    redis:
      image: redis
      restart: always
      env_file: ./docker.env
      ports:
        - &quot;6379:6379&quot;
      volumes:
        - ./redis.conf:/redis.conf
      command: [&quot;redis-server&quot;, &quot;/redis.conf&quot;]
  
    postgres:
      image: postgres
      restart: always
      env_file: ./docker.env
      ports:
        - &quot;5432:5432&quot;
      volumes:
        - database-data:/var/lib/postgresql/data
  
  volumes:
    database-data:
  </code></pre>
  <p>docker ps shows that redis and postgres are OK and that my outline app container is restarting</p>
  <pre><code>outlinewiki/outline:latest   &quot;docker-entrypoint.s…&quot;   2 minutes ago   Restarting (1) 20 seconds ago
  </code></pre>
  <p>Then I decided to check logs</p>
  <pre><code>ERROR: getaddrinfo EAI_AGAIN outline-wiki-db
  
  error Command failed with exit code 1.
  info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  yarn run v1.22.18
  $ sequelize db:migrate --env=production-ssl-disabled
  
  Sequelize CLI [Node: 16.14.2, CLI: 6.3.0, ORM: 6.9.0]
  
  Loaded configuration file &quot;server/config/database.json&quot;.
  </code></pre>
  <p>I can not login into container.</p>
  <p>Docker inspect shows</p>
  <pre><code>&quot;Path&quot;: &quot;docker-entrypoint.sh&quot;,
  &quot;Args&quot;: [
      &quot;sh&quot;,
      &quot;-c&quot;,
      &quot;yarn sequelize:migrate --env=production-ssl-disabled &amp;&amp; yarn start --env=production-ssl-disabled&quot;
  ],
  </code></pre>
  <p>Why do I get ERROR: getaddrinfo EAI_AGAIN ?</p>