fix: CI Postgres via hostname, sem bind :5432 no host
Some checks failed
CI / container (push) Waiting to run
CI / static (push) Successful in 1m24s
CI / unit (push) Failing after 1m31s
CI / feature (push) Failing after 1m14s
CI / browser (push) Failing after 2m10s

act_runner em VPS compartilhada falhava com port already
allocated; jobs usam service postgres na rede do job.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-12 15:02:24 -03:00
parent 1468a23145
commit 87a019109d
2 changed files with 13 additions and 9 deletions

View File

@@ -18,7 +18,9 @@ env:
BCRYPT_ROUNDS: 4
CACHE_STORE: database
DB_CONNECTION: pgsql
DB_HOST: 127.0.0.1
# Service hostname on the job network (act_runner). Do not publish
# host port 5432 — shared VPS runners collide (Bind … already allocated).
DB_HOST: postgres
DB_PORT: 5432
DB_DATABASE: amare_test
DB_USERNAME: amare
@@ -68,8 +70,6 @@ jobs:
POSTGRES_DB: amare_test
POSTGRES_USER: amare
POSTGRES_PASSWORD: secret
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U amare -d amare_test"
--health-interval 5s
@@ -108,8 +108,6 @@ jobs:
POSTGRES_DB: amare_test
POSTGRES_USER: amare
POSTGRES_PASSWORD: secret
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U amare -d amare_test"
--health-interval 5s
@@ -141,8 +139,6 @@ jobs:
POSTGRES_DB: amare_test
POSTGRES_USER: amare
POSTGRES_PASSWORD: secret
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U amare -d amare_test"
--health-interval 5s
@@ -170,7 +166,14 @@ jobs:
- name: Run browser tests against FrankenPHP container
run: |
# Join the job/service network so nested app reaches service "postgres"
# without publishing host :5432 (collides on shared act_runner hosts).
JOB_CID="$(hostname)"
JOB_NET="$(docker inspect -f '{{range $k, $_ := .NetworkSettings.Networks}}{{println $k}}{{end}}' "$JOB_CID" | head -n1)"
test -n "$JOB_NET"
docker run -d --name amare-web \
--network "$JOB_NET" \
-e APP_ENV=testing \
-e APP_KEY="${APP_KEY}" \
-e APP_URL=http://127.0.0.1:8000 \
@@ -178,7 +181,7 @@ jobs:
-e APP_FALLBACK_LOCALE=pt_BR \
-e APP_TIMEZONE=America/Sao_Paulo \
-e DB_CONNECTION=pgsql \
-e DB_HOST=host.docker.internal \
-e DB_HOST=postgres \
-e DB_PORT=5432 \
-e DB_DATABASE=amare_test \
-e DB_USERNAME=amare \
@@ -186,7 +189,6 @@ jobs:
-e SESSION_DRIVER=database \
-e CACHE_STORE=database \
-e QUEUE_CONNECTION=database \
--add-host=host.docker.internal:host-gateway \
-v "${GITHUB_WORKSPACE}/storage/app/public:/app/storage/app/public" \
-p 8000:8000 \
amare-app:ci