title: Configure dockerfile with postgres
body: <p>Trying to make Dockerfile for postgres db need for my app.</p>
  
  <p>Dockerfile    </p>
  
  <pre><code>FROM postgres:9.4
  RUN mkdir /sql
  COPY src/main/resources/sql_scripts/* /sql/
  RUN psql -f /sql/create_user.sql
  RUN psql -U user -W 123 -f create_db.sql
  RUN psql -U user -W 123 -d school_ats -f create_tables.sql
  </code></pre>
  
  <p>run</p>
  
  <pre><code>docker build .
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>Sending build context to Docker daemon 3.367 MB
  Step 1 : FROM postgres:9.4
   ---&gt; 6196bca94565
  Step 2 : RUN mkdir /sql
   ---&gt; Using cache
   ---&gt; 6f57c1e759b7
  Step 3 : COPY src/main/resources/sql_scripts/* /sql/
   ---&gt; Using cache
   ---&gt; 3b496bfb28cd
  Step 4 : RUN psql -a -f /sql/create_user.sql
   ---&gt; Running in 33b2230a12fa
  psql: could not connect to server: No such file or directory
      Is the server running locally and accepting
      connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
  The command '/bin/sh -c psql -a -f /sql/create_user.sql' returned a non-zero code: 2
  </code></pre>
  
  <p>How can I specify db in docker for my project?</p>