A workflow uses a PostgreSQL service container and runs the test job directly on an ubuntu runner, not inside a job container. The service maps 5432:5432. How should the test process connect?

Published
  1. Connect from the runner-host process to localhost:5432 through the service port mapped to host port 5432.
  2. Remove the port mapping because the database image EXPOSE declaration publishes the host port.
  3. Connect to the service label postgres:5432 without publishing any port.
  4. Connect from a separate Docker container to its own localhost without joining the service network.

Comments — 0