According to the documentation running docker compose on this yaml file:
services:
masterdb:
image: postgres:15.6-alpine
container_name: primary-server
ports:
- 5432:5432
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: psw
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
readonlydb:
image: postgres:15.6-alpine
container_name: hot-standby
ports:
- 5430:5432
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: psw
should initialise:
primary-server with init.sql.
However it does not happen even if the file is correctly mounted:
Ii tried, to delete/re build the images, delete all the volumes but nothing. The init.sql script is not executed.