0
Hello, all quiet folks ?
I’m messing with Docker-Compose configuring a system with Docker I’m mapping volumes with *.sh files in the directory /docker-entrypoint-initdb.d/
to start basic settings for my database:
version: '3.1'
services:
db:
image: postgres:9.6
ports:
- '5432:5432'
environment:
POSTGRES_DB: 'imn'
POSTGRES_PASSWORD: 'intelbras'
POSTGRES_USER: 'intelbras'
volumes:
- ./init:/docker-entrypoint-initdb.d/
inside the init folder I have a *.sh script running to create the schema
#!/bin/bash
set -e
psql -v --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE SCHEMA imn AUTHORIZATION intelbras
EOSQL
when I use the command
Docker-Compose up
he climbs the bank but does not create the schema someone could tell me where I am doing wrong ?
Tbm had thought about it, but found out that he was mapping a directory that had no file contained anything, put the *.sh file inside the directory and worked, thanks for the reply :)
– Matheus Freitas