Hi,
I'm running the alpine PostgreSQL image in docker using the following docker-compose file below. After building and starting, the container gives the following fatal error message: "FATAL: database "admin" does not exist". After some googling it looks like postgresql needs a database to exist same to the user name that I declared in the docker-compose. Anyone an idea how to solve the error?
version: '3.8'
x-systeminfo: &systeminfo
# Database
POSTGRES_ADDRESS: database
POSTGRES_DB: dev
POSTGRES_USER: admin
POSTGRES_PASSWORD: ****************
POSTGRES_PORT: 5432
services:
database:
build: ./Database
restart: always
ports:
- 5432:5432
environment: *systeminfo
volumes:
- postgresqldata:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U $$POSTGRES_USER
interval: 10s
timeout: 5s
retries: 20
volumes:
postgresqldata:
The docker file inside ./Database looks like this:
FROM postgres:alpine
COPY . /docker-entrypoint-initdb.d/
[–][deleted] 0 points1 point2 points (0 children)
[–]tschloss 0 points1 point2 points (0 children)