I have created Docker file which looks like this
db:
image: postgres:10.3
ports:
- "5432:5432"
environment:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: changeme
restart: always
volumes:
- ./srv/postgres:/var/lib/postgresql/data
- ./init/:/docker-entrypoint-initdb.d/
I have a sql script in ./init path which have sql commands to create database and user. I see the sql file created in the postgres container but somehow it is not executing. I have followed the documentation on the docker hub. I am not sure what is wrong here?