FATAL: role "root" does not exist
Подскажите в чём может быть проблема, делаю docker-compose.yml, как обычно, а тут такое: FATAL: role "root" does not exist. А yoyo-migrations вообще тянет POSTGRES_USER из системы (мой на компе)
version: '3.8'
services:
users1:
build: .
ports:
- "50051:50051"
depends_on:
- migration
users2:
build: .
ports:
- "50052:50051"
depends_on:
- migration
db:
container_name: postgres
env_file:
- ./.env
image: postgres:14.11
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
volumes:
- db-data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready", '-q', '-U', "${DB_USER}", "-d", "${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
migration:
env_file:
- ./.env
image: python:3.12.3
working_dir: /usr/src/app
command: sh -c "pip install psycopg2-binary yoyo-migrations && yoyo apply --database postgresql://${DB_USER}:${DB_PASSWORD}@db:5432/${DB_NAME} ./migrations"
depends_on:
db:
condition: service_healthy
volumes:
db-data:
Dockerfile:
FROM python:3.12.3
WORKDIR /usr/src/app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "src/main.py"]
Помогите пожалуйста, уже час сижу, посмотрел и на StackoverFlow и у ChatGPT