Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Problema de versão na execução da atividade

O arquivo yaml precisa ser atualizado:

version: '3.8'

services:

  database:
    image: postgres
    container_name: database-api-cursos
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ]
      timeout: 45s
      interval: 10s
      retries: 10
    environment:
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=h5UzM2kEnp8Q42
      - APP_DB_USER=alura
      - APP_DB_PASS=nJ6vsW37rCd1v88
    ports:
      - '5432:5432'
    volumes:
      - ./postgres/db:/docker-entrypoint-initdb.d/
      - ./postgres/data:/var/lib/postgresql/data
2 respostas
solução!

Precisa ser atualizado para:

version: '3.8'

services:

  database:
    image: postgres
    container_name: database-api-cursos
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ]
      timeout: 45s
      interval: 10s
      retries: 10
    environment:
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=h5UzM2kEnp8Q42
      - APP_DB_USER=alura
      - APP_DB_PASS=nJ6vsW37rCd1v88
      - APP_DB_NAME=logsdb
      - GOSU_VERSION=1.14    
      - PG_MAJOR=15
      - PG_VERSION=15.1-1.pgdg110+1
      - PGDATA=/var/lib/postgresql/data HOME=/root
    ports:
      - '5432:5432'
    volumes:
      - ./postgres/db:/docker-entrypoint-initdb.d/
      - ./postgres/data:/var/lib/postgresql/data

Arquivo corrigido.

version: '3.8'

services:

  database:
    image: postgres
    container_name: database-api-cursos
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ]
      timeout: 45s
      interval: 10s
      retries: 10
    environment:
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/15/bin
      - HOSTNAME=9226aec39768     
      - APP_DB_USER=alura
      - APP_DB_PASS=nJ6vsW37rCd1v88
      - APP_DB_NAME=logsdb     
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=h5UzM2kEnp8Q42      
      - GOSU_VERSION=1.14
      - LANG=en_US.utf8
      - PG_MAJOR=15
      - PG_VERSION=15.1-1.pgdg110+1
      - PGDATA=/var/lib/postgresql/data HOME=/root
    ports:
      - '5432:5432'
    volumes:
      - ./postgres/db:/docker-entrypoint-initdb.d/
      - ./postgres/data:/var/lib/postgresql/data