title: Solr running inside docker container is not connecting to PostgreSQL database
body: <p>I have PostgreSQL and Solr, in a docker container, running on the same machine. I am trying to do a dataimport from Postgres into Solr, but I am getting errors. Here are the relevant parts of the log:</p>
  
  <pre><code>Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: SELECT * FROM formulas
  
  org.postgresql.util.PSQLException: Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
  </code></pre>
  
  <p>Basically the connection is being refused/never made, but I'm confused.</p>
  
  <pre><code>netstat -nltp
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      772/sshd
  tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      1822/postgres
  tcp6       0      0 :::22                   :::*                    LISTEN      772/sshd
  tcp6       0      0 :::8983                 :::*                    LISTEN      28508/docker-proxy
  tcp6       0      0 ::1:5432                :::*                    LISTEN      1822/postgres
  </code></pre>
  
  <p>And says that Postgres is listening on <code>127.0.0.1</code>. Additionally, in my <code>pg_hba.conf</code>, I have</p>
  
  <pre><code>local   all             postgres                                peer
  
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     peer
  local   all             all                                     md5
  # IPv4 local connections:
  host    all             all             127.0.0.1/32            trust
  # IPv6 local connections:
  host    all             all             ::1/128                 md5
  </code></pre>
  
  <p>which I believe are the correct settings for allowing connections.</p>
  
  <p>My solrconfig.xml that is responsible for the data import settings looks like this:</p>
  
  <pre><code>&lt;dataConfig&gt;
    &lt;dataSource driver="org.postgresql.Driver"
            url="jdbc:postgresql://127.0.0.1:5432/formulagrid"
            user="myuser"
            password="mypassword"/&gt;
    &lt;document&gt;
      &lt;entity name="formula" query="SELECT * FROM formulas"&gt;
        &lt;field column="formula_id" name="id" /&gt;
        &lt;field column="name" name="name" /&gt;
        &lt;field column="formula" name="formula" /&gt;
      &lt;/entity&gt;
    &lt;/document&gt;
  &lt;/dataConfig&gt;
  </code></pre>
  
  <p>I have also tried the address <code>jdbc:postgresql://localhost:5432/formulagrid</code>.</p>
  
  <p>I don't know where else to go from here.</p>