Подключаюсь к контейнеру
psql -h localhost -p 5432
Password for user root:
Ввожу
postgres
psql: error: connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "root"
version: '3.5'
services:
postgres:
container_name: postgres_container
image: postgres
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- ${POSTGRES_PORT}:${POSTGRES_PORT}
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 1s
timeout: 1s
retries: 60
networks:
- ${NETWORK}
restart: always
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_PORT=5432
NETWORK=public
Или окружение
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
Или, если это не
root
пользователь
Но тогда где указывается пароль для root пользователя?