fix(rallly,spliit): postgres のデータディレクトリを uid 70 所有にする - #396
Merged
Conversation
#394 をデプロイしたら両方の DB コンテナが起動に失敗した。 mkdir: can't create directory '/var/lib/postgresql/18/': Permission denied tmpfiles で 0700 root root で作っていたが、postgres のイメージは uid 70 で 動くので書き込めない。既存の miniflux/db を見たら uid 70 所有だったので、 最初からそちらに揃えるべきだった。 実機で 0700 70 70 のディレクトリに postgres:18-alpine を当てて、 "database system is ready to accept connections" まで到達することを確認済み。 calnode と readeck が root 所有で動いていたのは、あちらのイメージが コンテナ内 root で動くから。DB だけが uid を落とす。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#394 をデプロイしたら、Rallly と Spliit の DB コンテナが両方とも起動に失敗しました。その修正です。
何が起きたか
tmpfiles で
0700 root rootとして作っていましたが、postgres のイメージは uid 70 で動くので書き込めません。既存の
miniflux/dbを見たら uid 70 所有でした。最初からこちらに揃えるべきでした。
Calnode と Readeck が
0700 root rootで動いていたのは、あの2つのイメージがコンテナ内 root で動くからです。DB だけが uid を落とすので、同じルールが通用しませんでした。前回の PR で「readeck と同じ形にした」と書いたのは、この点で雑でした。検証
実機で
0700 70 70のディレクトリを作り、postgres:18-alpineを当てて確認しました。使い捨てのディレクトリで試して後片付け済みです。
デプロイ時の注意
失敗した初回起動が
rallly-db/18/(root 所有)を作って残しているので、rebuild の前にそれを消す必要があります。中身は初期化に失敗した空の状態で、データはありません。