Answer the question
In order to leave comments, you need to log in
Why is user and database not created for postgresql in docker container?
I want to deploy a development environment on docker containers.
One of the containers is postgresql, with the following configuration in docker-compose.yml
version: '2'
services:
postgresql:
image: postgres:9.6
ports:
- '5432:5432'
volumes:
- /home/username/pgdata:/var/lib/postgresql/data
container_name: postgresql
environment:
POSTGRES_DB: testdb
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
psql -h localhost -p 5432 -U admin -d testdb -W
psql: FATAL: role "admin" does not exist
volumes:
- /home/username/pgdata/dbfirst:/var/lib/postgresql/data
volumes:
- /home/username/pgdata/dbsecond:/var/lib/postgresql/data
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question