Configure Discourse to use a separate PostgreSQL server

Google Cloud의 VM에서 Docker를 통해 새로 설치한 Discourse 인스턴스를 실행 중입니다. 현재 파일 업로드와 Discourse 백업을 Google Cloud 버킷으로 설정했으며, S3 호환 객체 저장소 제공업체를 업로드용으로 설정하는 스레드의 지침을 따름으로써 해당 기능이 정상적으로 작동하고 있습니다. 버킷에서 테스트 업로드 파일을 확인할 수 있으며, 업로드 URL을 살펴보면 모든 업로드가 CDN의 올바른 URL을 표시하므로 버킷에서 올바르게 가져오고 있는 것으로 보입니다.

이후 Google Cloud에서 PostgreSQL 15.2 인스턴스를 생성하고, 첫 번째 게시물에 설명된 데이터베이스 설정 절차를 수행했으며 app.yml 파일도 설정했습니다. Google Cloud의 PostgreSQL 기본 포트는 5432이므로 해당 줄을 생략했습니다.
app.yml 설정에 PostgreSQL 인스턴스의 공용 IP 주소를 사용하면 앱을 다시 빌드할 때 다음과 같은 오류가 발생합니다:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1024 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
a6a71b00bce378aa6334ae1c9fe103778d260bb699fe598f9685689e8b5ce450

무슨 일이 일어나고 있는지 확인하기 위해 PostgreSQL 인스턴스의 다른 IP 주소들을 시도해 보았습니다.
PostgreSQL 인스턴스의 비공용(프라이빗) IP 주소를 사용하면 다음과 같은 오류가 발생합니다:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1024 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
7333126c522eb51ace4d55ea89803eea54b96704baab70c322008cf2836ba47a

PostgreSQL 인스턴스의 대외 IP(outgoing IP) 주소를 사용하면 다음과 같은 오류가 발생합니다:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 1026 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
c588d2b6977b9e7d493b0b59bc694369cb7c2219de67d5886112ed16312626ae

모든 다른 IP 주소를 사용해도 실패 메시지는 매우 유사하며, PostgreSQL 데이터베이스에는 데이터나 연결이 전혀 수신되지 않습니다. 제가 어디에서 실수를 하고 있는지 통찰을 주실 분이 계신가요?

또한, 제 문제가 VM 인스턴스에서 Cloud SQL Auth Proxies를 사용하지 않기 때문에 발생하는 것일까요? 그렇다면 앱 재빌드 전에 프록시를 실행하는 스크립트를 작성하고 타이밍을 맞춰야 할 것 같습니다. 이 부분에 대해서도 조언을 주실 분이 계신가요?

시간 내어 답변 주셔서 감사합니다.