access issue with postgresql 14 docker image on MacOS Sonoma

Поиск
Список
Период
Сортировка
Искать
От
Richard Welty
Тема
access issue with postgresql 14 docker image on MacOS Sonoma
Дата
Msg-id
18dc36236cd.d2e96e751765010.809842237628531499@salesium.com
Список
Дерево обсуждения
access issue with postgresql 14 docker image on MacOS Sonoma Richard Welty <rwelty@salesium.com>
Re: access issue with postgresql 14 docker image on MacOS Sonoma Richard Welty <rwelty@salesium.com>
we're using Postgresql 14 with our Laravel/Php appliction. it is working well
in EC2 and in a Docker image on my Ubuntu 22.04 desktop at work. however,
a while back it stopped working with Docker on my Macbook Air in response
to a major OS upgrade. wondering if anyone knows what i might need to change to fix
this.
the docker image is launching, i can open a terminal in docker-desktop and use psql
to connect to it and poke about with a stick. i can also access it via pgadmin using
localhost with port 5432 as expected.

but when i try to migrate the db schema using Laravel Sail, i get the following error:

  SQLSTATE[08006] [7] connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (::1), port 5432 failed: Cannot assign requested address
Is the server running on that host and accepting TCP/IP connections? (SQL: select tablename, concat('"', schemaname, '"."', tablename, '"') as qualifiedname from pg_catalog.pg_tables where schemaname in ('public'))

this suggests that postgresql is not being configured properly for access from the container
containing the web app. i have included the configurations from docker-compose.yml below -
but this is the same docker-compose.yml that is currently working on Ubuntu and was working
until the MacOS upgrade, so i'm kind of baffled.

TIA, richard

--------------

Docker compose snippet

   salesium.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.1
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.1/app
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '${APP_PORT:-80}:80'
            - '${HMR_PORT:-8080}:8080'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - pgsql
    pgsql:
        image: 'postgres:14'
        ports:
            - '${FORWARD_DB_PORT:-5432}:5432'
        environment:
            PGPASSWORD: '${DB_PASSWORD:-secret}'
            POSTGRES_DB: '${DB_DATABASE}'
            POSTGRES_USER: '${DB_USERNAME}'
            POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
        volumes:
            - 'sail-pgsql:/var/lib/postgresql/data'
            - './vendor/laravel/sail/database/pgsql/create-testing-database.sql:/docker-entrypoint-initdb.d/10-create-testing-database.sql'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}"]
            retries: 3
            timeout: 5s



В списке pgsql-general по дате отправления
От: Adrian Klaver
Дата:
От: Tim Palmer
Дата:
FAQ