title: .sql file in docker-entrypoint-initdb not being run
body: <p>I am using docker-compose 3.7 to run Postgresql but I can't get my init.sql to run through the docker-entrypoint-initdb.d entry point. </p>
  
  <p>I understand that the volume directory on my machine needs to be empty but I am sure that I am doing that correctly. I must be missing something fairly simple/obvious.</p>
  
  <pre><code>version: '3.7'
  
  services:
  
    postgresdb:
      environment:
        POSTGRES_DB: appdb
        POSTGRES_USER: appdb 
        POSTGRES_PASSWORD: ########
      image: bitnami/postgresql:latest
      ports:
        - "5432:5432"
      volumes:
      - ./db/postgres_volume:/bitnami:rw
      - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
      restart: always
  </code></pre>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE user (
          id SERIAL NOT NULL PRIMARY KEY,
          name VARCHAR(255) NOT NULL
  );
  </code></pre>
  
  <p>My volume directory is empty.</p>
  
  <pre><code>$ ls db/postgres_volume/
  $ 
  </code></pre>
  
  <p>The container starts with no issues but from the logs, I can't tell if the init.sql script was executed. Scripts seemed to be loaded but I am not sure about execution.</p>
  
  <pre><code>$ docker-compose -f docker-compose.yml up -d postgresdb 
  Creating network "app_default" with the default driver
  Creating app_postgresdb_1 ... done
  $
  </code></pre>
  
  <pre><code>postgresdb_1  | INFO  ==&gt; Loading custom scripts...
  postgresdb_1  | INFO  ==&gt; Loading user's custom files from /docker-entrypoint-initdb.d ...
  postgresdb_1  | INFO  ==&gt; Starting PostgreSQL in background...
  </code></pre>
  
  <p>Logging into the container and then into my database, I see no tables.</p>
  
  <pre><code>$ docker exec -it 737845344cf2 bash
  I have no name!@737845344cf2:/$ psql -U appdb appdb
  appdb=&gt; \dt
  Did not find any relations.
  </code></pre>
  
  <p>After the container is created, I see a "postgresql" folder db/postgres_volume but is has no contents.</p>
  
  <pre><code>$ ls db/postgres_volume/
  postgresql
  
  $ ls db/postgres_volume/postgresql/
  $
  </code></pre>