I am using docker-compose to deploy a multicontainer python Flask web application. I\'m having difficulty understanding how to create tables in the postgresql database durin
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:
COPY
Dockerfile
init.sql
docker-compose.yml
volumes: - ./init.sql:/docker-entrypoint-initdb.d/init.sql
init.sql was in the same catalog as my docker-compose.yml. I picked the solution from here.