Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Symfony console does not detect docker #60891

Open
@vbulash

Description

@vbulash

Symfony version(s) affected

6.4

Description

  • Ubuntu 25.04
  • PHP 8.4
  • Symfony 6.4
  • Docker Desktop

Newly installed Guestbook application (from Symfony Book). Here web and docker support added.
Cannot work with docker container as it is written in Book (see steps to reproduce).
It is not a problem of PostgreSQL, because I can enter into psql both from outside (host=localhost) and from inside docker container (host=app).

How to reproduce

  1. Install Guestbook as symfony new guestbook --version=6.4 --php=8.4 --webapp --docker
  2. Start docker as docker compose up -d.
  3. Inspect Guestbook running containers by docker ps | grep guest:
7ac2942bb534   postgres:16-alpine         "docker-entrypoint.s…"   41 hours ago   Up About a minute             0.0.0.0:35687->5432/tcp, [::]:35687->5432/tcp                                                  guestbook-database-1
04843630f828   axllent/mailpit            "/mailpit"               42 hours ago   Up About a minute (healthy)   0.0.0.0:39031->1025/tcp, [::]:39031->1025/tcp, 0.0.0.0:45531->8025/tcp, [::]:45531->8025/tcp   guestbook-mailer-1
  1. Try to work with containerized database by symfony run psql:
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions