
ショコラ
ドッカーコンポーズでホストを定義するには?
「extra_hosts」で定義する。

もっさん先輩
extra_hosts:
- "{ホスト名}:{IPアドレス}"
例
version: '3'
services:
app:
image: busybox
command: cat /etc/hosts
extra_hosts:
- "host.docker.internal:host-gateway"
- "db:192.168.0.100"
定義するホストをダブルクォートで囲っています。