What is:
docker-compose config
version: '2' services: web: image: nginx hostname: site.dev links: - app ports: - "80:80" app: image: php volumes: - /var/www:/var/www Problem:
I run the docker-composer run app curl -v site.dev and get the curl: (7) Failed to connect to site.dev port 80: Connection refused error curl: (7) Failed to connect to site.dev port 80: Connection refused . If you run the docker-composer run app curl -v web then everything is fine
Question:
How can the "app" container report that the "web" container has the domain name site.dev?
Addition:
- it is impossible to add app
links web:site.devfor the container, because it curses circular dependency site.dev:172.17.0.2can add extra_hosts likesite.dev:172.17.0.2, but you have to correct the ip address every time- You can create a builder where it will be added to / etc / hosts
172.17.0.2 site.dev, but the problem will be the same as in the example above