title: Docker-Compose freezing on database-creation
body: <p>I wish to expand a web-application using docker (I'm beginner in Docker). My application demands PostgreSQL. Therefore I decided to use the docker-compose.</p>
  
  <p>The <code>docker-compose.yaml</code> looks like:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>version: '3.8'
  
  services: 
      db:
          image: postgres
          command: "postgres -c listen_addresses='*'"
          environment:
              - POSTGRES_DB=CatsQMS
              - POSTGRES_USER=postgres
              - POSTGRES_PASSWORD=12345qwerty
  
      application:
          build: .
          ports:
              - "8080:8080"
          depends_on:
              - db
  </code></pre>
  
  <p>Also I have the file <code>config.yaml</code> which configures my web-application, it looks like this:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>database_config:
    host: db
    user: postgres
    password: 12345qwerty
    port: 5432
    database: CatsQMS
  
  # Unimportant stuff
  </code></pre>
  
  <p>And when I lunch the docker-compose, using <code>docker-compose up</code> the build is freezing at this point:</p>
  
  <pre><code>Recreating cats_queue_management_system_db_1 ... done
  Recreating cats_queue_management_system_application_1 ... done
  Attaching to cats_queue_management_system_db_1, cats_queue_management_system_application_1
  db_1           |
  db_1           | PostgreSQL Database directory appears to contain a database; Skipping initialization
  db_1           |
  db_1           | 2020-05-20 13:42:51.628 UTC [1] LOG:  starting PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
  db_1           | 2020-05-20 13:42:51.628 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
  db_1           | 2020-05-20 13:42:51.628 UTC [1] LOG:  listening on IPv6 address "::", port 5432
  db_1           | 2020-05-20 13:42:51.635 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
  db_1           | 2020-05-20 13:42:51.660 UTC [24] LOG:  database system was shut down at 2020-05-20 13:39:45 UTC
  db_1           | 2020-05-20 13:42:51.673 UTC [1] LOG:  database system is ready to accept connections
  </code></pre>
  
  <p>Perhaps it's an important thing, my Dockerfile:</p>
  
  <pre><code>FROM python:3.8
  
  RUN mkdir /docker-entrypoint-initdb.d/
  
  COPY ./application/sources/database/init.sql /docker-entrypoint-initdb.d/
  
  RUN mkdir /app
  
  WORKDIR /app
  
  COPY . /app
  
  RUN pip install -r requirements.txt
  
  RUN python3 setup.py develop
  
  ENTRYPOINT ["start_app", "-d"]
  </code></pre>
  
  <p>Where have I admitted a mistake?</p>