Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topic/add supabase to docker compose yml #594

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

TsurutaYoshiki
Copy link
Collaborator

@TsurutaYoshiki TsurutaYoshiki commented Feb 7, 2025

PR の目的

  • supabaseを既存のdocker-compose-local.ymlに組み込んだdocker-compose-supabase-local.ymlファイルを作成しました

経緯・意図・意思決定

  • docker-compose-supabase-local.yml

    • docker-compose-local.ymlにsupabaseのコンテナを追加しました
    • studio, kong, auth, meta, supabase-dbコンテナを追加しました
    • 既存のdbコンテナをsupbaseのdbコンテナと識別するためにthreatconnectome-dbに名前を変更しました
    • Firebaseコンテナについて削除しました
  • .env.supabase.example

    • 既存の.env.exampleにsupabaseに必要な環境変数を追加しました
    • Firebaseの環境変数については削除しました
  • volumes

  • apiコンテナ

    • 現状のdocker-compose-supabase-local.ymlを使ってコンテナを立ち上げるとき、apiコンテナについてはmain.pyにfirebaseの設定が残っているためコンテナが起動しないです。

参考文献

@TsurutaYoshiki TsurutaYoshiki marked this pull request as ready for review February 7, 2025 10:23
Copy link
Collaborator

@mshim03 mshim03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • volumes だとわかりづらいので、supabase-volume などsupabase用ということがわかるようにして欲しいです
  • .env.supabase.example はどのように使う想定でしょうか? .env というファイルにリネームする想定であってますかね?
  • .env.supabase.example がほとんど空白になっていますが、パスワードなど機密性が高い情報以外はデータとして入れておくのがいいと思います
  • apiはdocker-composeの env_file 設定を使っているのに、supabseは全部composeファイルに記載しているのでチグハグな印象があります。統一した方がいいかもしれません

@dejima-shikou
Copy link
Collaborator

dejima-shikou commented Feb 12, 2025

既存の.env.exampleを.env.firebase.exampleとリネームすべき
README.mdにも「.env.example」の記載あり

@TsurutaYoshiki
Copy link
Collaborator Author

TsurutaYoshiki commented Feb 12, 2025

以下6点を変更しました

  • volumesにあったdb-configの名前の変更
    • supabase-db-configに変更しました
  • .env.supabase.exampleにパスワードなど機密性が高い情報以外はデータとして入れてるようにしました
  • apiコンテナの設定でenv_filを使用していましたが廃止しました
    • 環境変数の設定についてはenvironmentで行い、他のコンテナと設定方法を統一しました
  • 既存の.env.exampleを.env.firebase.exampleにリネーム
    • README.mdにある.env.exampleについても.env.firebase.exampleにリネームしました
  • firebase, supabaseか判別するAUTH_SERVICEフラグを.env.firebase.example, .env.supabase.exampleに追加
  • テストについても同様にymlファイルをdocker-compose-test-supabase.ymlという名前で作成しました。

DB_HOST=db
DB_PORT=5432
DB_SCHEMA=postgres
TESTDB_HOST=testdb
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testdbが
test-threatconnectome-db
になりませんか?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コンテナ名をtest-threatconnectome-dbではなくtestdbに修正しました。
環境変数の方はtestdbのままにしています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants