前言
當 Browser 進入 H2 Console 登入畫面時, 顯示 remote connections ('webAllowOthers') are disabled on this server.

為什呢??Docker 會觸發這個錯誤?
在 Docker 環境下,容器內部 IP 與宿主機(你的電腦)不同,H2 預設只允許 localhost 存取. 如果你沒有成功開啟 web-allow-others, H2 會拒絕透過 8070 埠從外部連入的請求.
修復選項
- 透過環境變數強制開啟, 可以在執行
docker run時透過環境變數覆蓋設定,這是最快且最保險的方法
docker run -p 8070:8070 -e SPRING_H2_CONSOLE_SETTINGS_WEB_ALLOW_OTHERS=true dannyyu/accounts:v1
