Using –add-host or extra_hosts with docker-compose

https://github.com/compose-spec/compose-spec/blob/master/spec.md#extra_hosts

extra_hosts – Add hostname mappings.
Uses the same values as the docker client –add-host parameter.

extra_hosts:
 - "somehost:162.242.195.82"
 - "otherhost:50.31.209.229"

An entry with the ip address and hostname will be created in /etc/hosts > inside containers for this service, e.g:

162.242.195.82  somehost
50.31.209.229   otherhost

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)