Postgres 컨테이너 빌드 중 사용자 비밀번호 변경 오류

컨테이너에 Postgres가 성공적으로 설치된 후, 런처 스크립트는 discourse 사용자의 비밀번호를 변경하려고 시도합니다. 그러나 다음과 같은 오류가 발생합니다.

Pups::ExecError: su - postgres -c 'psql discourse' failed with return #<Process::Status: pid 100 exit 141>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"stdin"=>"alter user discourse with password 'redacted';\n", "cmd"=>"su - postgres -c 'psql discourse'", "raise_on_fail"=>true}
bootstrap failed with exit code 141
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

이 명령에 도달했을 때 Postgres가 실행되지 않아 파이프가 깨진 상태로 실패하는 것 같습니다. 하지만 제 postgres.yml은 data.yml 샘플 파일 기반으로 작성했기 때문에 제가 무엇을 잘못하고 있는지 모르겠습니다. 혹시 아이디어가 있으신가요?

부탁이 하나 있습니다.

그 내용을 여기에 공유해 주시겠어요?

안녕하세요, 이전 로그에는 특이사항이 없었지만, 컨테이너 로그에서 다음 메시지를 확인했습니다.

2024-01-26 12:30:54 I, [2024-01-26T17:30:54.465403 #1]  INFO -- : Reading from stdin
2024-01-26 12:30:54 /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/config.rb:22:in `block in initialize': undefined method `has_key?' for nil:NilClass (NoMethodError)
2024-01-26 12:30:54 
2024-01-26 12:30:54         @config[key] = {} unless @config.has_key?(key)
2024-01-26 12:30:54                                         ^^^^^^^^^
2024-01-26 12:30:54     from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/config.rb:21:in `each'
2024-01-26 12:30:54     from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/config.rb:21:in `initialize'
2024-01-26 12:30:54     from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/cli.rb:68:in `new'
2024-01-26 12:30:54     from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/cli.rb:68:in `run'
2024-01-26 12:30:54     from /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/bin/pups:9:in `<top (required)>'
2024-01-26 12:30:54     from /usr/local/bin/pups:25:in `load'
2024-01-26 12:30:54     from /usr/local/bin/pups:25:in `<main>'

이로 인해 after_postgres 비밀번호 변경 부분이 주석 처리되어 있는 경우에도 컨테이너가 충돌하며, 여기서 broken pipe 문제가 발생합니다.