From 19b7c43f378210246b8d2cdefa1899703c3ed7cf Mon Sep 17 00:00:00 2001 From: rosemariejebbjtxbfp Date: Fri, 19 Jun 2026 08:54:18 +0000 Subject: [PATCH] ci: connect to postgres via service hostname for Gitea Actions Gitea Actions runs jobs inside a container, so a service container is reachable by its service name (postgres), not localhost; localhost:5432 yields connection refused. Also drop the unnecessary 5432:5432 host port mapping that caused 'port already allocated' collisions. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87d74ae..e166a85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,13 +19,11 @@ jobs: POSTGRES_USER: opengoods POSTGRES_PASSWORD: opengoods POSTGRES_DB: opengoods - ports: - - "5432:5432" options: >- --health-cmd "pg_isready -U opengoods" --health-interval 5s --health-timeout 5s --health-retries 10 env: - OPENGOODS_DATABASE_URL: postgres://opengoods:opengoods@localhost:5432/opengoods?sslmode=disable + OPENGOODS_DATABASE_URL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -73,13 +71,11 @@ jobs: POSTGRES_USER: opengoods POSTGRES_PASSWORD: opengoods POSTGRES_DB: opengoods - ports: - - "5432:5432" options: >- --health-cmd "pg_isready -U opengoods" --health-interval 5s --health-timeout 5s --health-retries 10 env: - DBURL: postgres://opengoods:opengoods@localhost:5432/opengoods?sslmode=disable + DBURL: postgres://opengoods:opengoods@postgres:5432/opengoods?sslmode=disable steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 -- 2.52.0