fix[typing-server]: 接続するDBのアドレスを環境変数で指定できるように #13
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.
チケットへのリンク
(省略)
やったこと
DB_ADDR
から設定するように変更したやらないこと
できるようになること(ユーザ目線)
できなくなること(ユーザ目線)
動作確認
🙆♂️ まず適当なアドレスを指定すると繋がらないことを確認
🙆♂️ 次に docker-compose.yml の db サービスに割り当てられたアドレス(db や typing-server-db-1 も同様)で繋がることを確認
$ docker compose run --rm --env DB_ADDR=172.28.1.5:3306 api [+] Creating 1/0 ✔ Container typing-server-db-1 Running 0.0s 2024/03/10 05:00:11 INFO ent client is opened 2024/03/10 05:00:11 INFO schema is created 2024/03/10 05:00:11 INFO server is running at Addr :8080 ^C2024/03/10 05:00:12 INFO received signal: %s !BADKEY=interrupt ^C2024/03/10 05:00:13 INFO shutting down the server... 2024/03/10 05:00:13 INFO server exited