docker-postgresql-multiple-databases
docker-postgresql-multiple-databases copied to clipboard
Using multiple databases with the official PostgreSQL Docker image
Add the capability to specialize each entries using following format, double colon separated: ```txt database:user:password ``` Signed-off-by: Helio Chissini de Castro
- Added exists check for database and user - Added `--dbname "postgres"` in `psql` command - Added owner, utf8 encoding, collate and template
Hi. In your example, there is one significant drawback. If the user or database named "$database" exists, then the script will simply stop and stop working, and the container start...
Snippet of my config : ```yaml postgres: image: postgres:10-alpine container_name: postgres ports: - 5432:5432 volumes: - "./.data/postgresql:/var/lib/postgresql/data" - ./utils/postgres:/docker-entrypoint-initdb.d environment: POSTGRES_MULTIPLE_DATABASES: "service_database, service_database_test" POSTGRES_PASSWORD: "password" POSTGRES_USER: "service_database" ``` In this...
POSTGRES_MULTIPLE_DATABASES: unbound variable
Update shell script and guidance to create multiple databases with passwords.
This section of the documentation does not work: ``` Non-standard database names If you need to use non-standard database names (hyphens, uppercase letters etc), quote them in POSTGRES_MULTIPLE_DATABASES: environment: -...
This will remove the need to add quotes.
Using a reasonably new version of postgres image (tried 16-alpine), you would get a ``` FATAL: database "myapp" does not exist ``` See https://dev.to/nietzscheson/multiples-postgres-databases-in-one-service-with-docker-compose-4fdf#comment-2fd1m for further discussion and a possible...