savannaæ¥å ±ããæ¹å¤ãã¦ããã°ã«æ¸ã試ã¿
ref: slackã®huddleè¯ããã - savanna.io
- Railsãdockerç°å¢ã§ãªããã°headlessã§ã¯ãªãchromeã使ãã®ã楽
- Railsãdockerç°å¢ã§ããã°ãremote debuggingãæå¹ã«ãã
remote-debugging-port=9222
remote-debugging-address=0.0.0.0
- ãã®2ã¤ããªãã·ã§ã³ã«ã¤ãã¦headless chromeãç«ã¡ä¸ãã
- ãã¡ããdocker-compose.ymlã§9222ãã¼ãã«ã¢ã¯ã»ã¹ã§ããããã«ãã¦ããå¿ è¦ããã
binding.pryãªã©ã®ãã¬ã¼ã¯ãã¤ã³ãããããã¦ãã¹ããå®è¡ãããã¬ã¼ã¯ãã¤ã³ãã§æ¢ã¾ã£ããããããã« localhost:9222 ã«ã¢ã¯ã»ã¹ããã¨ãã®æã®ç»é¢ã表示ã§ãã- ãã®ã¨ãããã¹ããå®è¡ããç°å¢ãdocker-compose runã§å®è¡ãã¦ããã¨è¡¨ç¤ºã§ããªã
- ããã©ã«ãã ã¨ããã¨ãdocker-compose.ymlã«é©åã«portsã®è¨å®ããã¦ããã¹ãå´ããã¯æ¥ç¶ã§ããªãã¨ããä»æ§
docker-compose up
ãã¦ããç¶æ³ã§docker-compose runã§ã¯ã³ã¿ã¤ã ãªã³ãã³ããå®è¡ããã¨ãã«portã被ã£ã¦ã¨ã©ã¼ã«ãªããã¨ããã®ãé²ããã- ref: https://github.com/docker/compose/issues/1259
docker-compose run --service-ports hoge
ã®ããã«service-portsãªãã·ã§ã³ãä»ããã¨ãã¹ãããã¤ãªããã¨ãã§ãã
2024/01/23追è¨
- åå ã¯ããããªãã®ã§ãããç¾æç¹ã§ã¯ localhost:9222 ã«ã¢ã¯ã»ã¹ãã¦ãçã£ç½ãªãã¼ã¸ã表示ãããã ãã«ãªã£ã¦ãã¾ãã
- chrome://inspect/ ã«ã¢ã¯ã»ã¹ãã¦ãâã® Remote Target ã®inspectãªã³ã¯ãã¯ãªãã¯ããã¨ãããã°ç¨ã®ç»é¢ã«é·ç§»ã§ãã¾ãã