fix(ci): use --alias when connecting infra to meezi_default network
CI/CD / CI · API (dotnet build + test) (push) Successful in 44s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 47s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m4s
CI/CD / CI · Admin Web (tsc) (push) Successful in 35s
CI/CD / CI · Website (tsc) (push) Successful in 44s
CI/CD / CI · Koja (tsc) (push) Successful in 48s
CI/CD / Deploy · all services (push) Successful in 1m36s
CI/CD / CI · API (dotnet build + test) (push) Successful in 44s
CI/CD / CI · Admin API (dotnet build) (push) Successful in 47s
CI/CD / CI · Dashboard (tsc) (push) Successful in 1m4s
CI/CD / CI · Admin Web (tsc) (push) Successful in 35s
CI/CD / CI · Website (tsc) (push) Successful in 44s
CI/CD / CI · Koja (tsc) (push) Successful in 48s
CI/CD / Deploy · all services (push) Successful in 1m36s
Without --alias, meezi-db joins meezi_default but is only reachable as "meezi-db". The API uses Host=postgres — DNS lookup fails after ~5s, migration throws, container crashes. Fix: disconnect first, then reconnect with service-name aliases so "postgres" and "redis" resolve correctly on meezi_default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -322,15 +322,17 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Attach infrastructure to meezi network
|
||||
# The postgres/redis containers may have been created before the compose
|
||||
# project name was locked to "meezi", so they live on a different network.
|
||||
# New app containers join meezi_default — connect infra to that network
|
||||
# so the API can reach "postgres" and "redis" by service name.
|
||||
# postgres/redis may be on a different network (created before name:meezi
|
||||
# was in the compose file). Disconnect/reconnect with service-name aliases
|
||||
# so the API can resolve "Host=postgres" and "redis:6379".
|
||||
# App containers are stopped at this point so the brief disconnect is safe.
|
||||
run: |
|
||||
docker network inspect meezi_default >/dev/null 2>&1 \
|
||||
|| docker network create meezi_default
|
||||
docker network connect meezi_default meezi-db 2>/dev/null || true
|
||||
docker network connect meezi_default meezi-redis 2>/dev/null || true
|
||||
docker network disconnect meezi_default meezi-db 2>/dev/null || true
|
||||
docker network disconnect meezi_default meezi-redis 2>/dev/null || true
|
||||
docker network connect --alias postgres meezi_default meezi-db
|
||||
docker network connect --alias redis meezi_default meezi-redis
|
||||
|
||||
- name: Deploy main app services
|
||||
run: |
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user