Using docker-compose to create tables in postgresql database

It didn’t work for me with the COPY approach in Dockerfile. But I managed to run my init.sql file by adding the following to docker-compose.yml:

    volumes:
        - ./init.sql:/docker-entrypoint-initdb.d/init.sql

init.sql was in the same directory as my docker-compose.yml.
I picked the solution from this gist. Check this article for more information.

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.