Running tech stacks
[strong]
Linux
Mac/Windows
[strong]
docker run
docker compose
[code]docker run --add-host host.docker.internal:host-gateway ...Mac/Windows -> host.docker.internal
[code]docker run -it --network host ...Linux -> use host
Mac/Windows use [inlineCode]host.docker.internal, cannot use [inlineCode]localhost / [inlineCode]127.0.0.1
docker-compose.yaml
[code]# ... services: serviceName: build: context: . dockerfile: ./Dockerfile ## For macos/Windows extra_hosts: - "host.docker.internal:host-gateway" # ...[code]# ... services: serviceName: build: context: . dockerfile: ./Dockerfile ## For Linux network_mode: host # ...Linux use host or bridge, and then can use [inlineCode]localhost / [inlineCode]127.0.0.1 docker-compose.yaml
References
[link]