{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/1110","labels_url":"https://api.github.com/repos/docker/compose/issues/1110/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/1110/comments","events_url":"https://api.github.com/repos/docker/compose/issues/1110/events","html_url":"https://github.com/docker/compose/issues/1110","id":61090871,"number":1110,"title":"Link to a service which isn't a Docker container","user":{"login":"aanand","id":1062,"avatar_url":"https://avatars.githubusercontent.com/u/1062?v=3","gravatar_id":"","url":"https://api.github.com/users/aanand","html_url":"https://github.com/aanand","followers_url":"https://api.github.com/users/aanand/followers","following_url":"https://api.github.com/users/aanand/following{/other_user}","gists_url":"https://api.github.com/users/aanand/gists{/gist_id}","starred_url":"https://api.github.com/users/aanand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aanand/subscriptions","organizations_url":"https://api.github.com/users/aanand/orgs","repos_url":"https://api.github.com/users/aanand/repos","events_url":"https://api.github.com/users/aanand/events{/privacy}","received_events_url":"https://api.github.com/users/aanand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-13T15:10:16Z","updated_at":"2015-04-29T16:01:53Z","closed_at":null,"body":"In production, your database might not be running inside a Docker container, but it's useful to be able to represent it logically inside Compose as a service.\r\n\r\nCompose should have a concept of \"external\" services, which specify a host/port and can be \"linked\" from other services. For example:\r\n\r\n```yaml\r\ndb:\r\n  type: external\r\n  host: 1.2.3.4\r\n  port: 5432\r\n  environment:\r\n    POSTGRES_USER: produser\r\n    POSTGRES_PASSWORD: prodpass\r\n```\r\n\r\nThis results in services which link to this service being furnished with hostnames and environment variables in exactly the same way as if they were linked to a Docker container:\r\n\r\n```bash\r\n$ docker-compose run web cat /etc/hosts\r\n127.0.0.1  localhost\r\n1.2.3.4    db\r\n\r\n$ docker-compose run web env\r\nDB_PORT=tcp://1.2.3.4:5432\r\nDB_PORT_5432_TCP=tcp://1.2.3.4:5432\r\nDB_PORT_5432_TCP_ADDR=1.2.3.4\r\nDB_PORT_5432_TCP_PORT=5432\r\nDB_PORT_5432_TCP_PROTO=tcp\r\nDB_ENV_POSTGRES_USER=produser\r\nDB_ENV_POSTGRES_PASSWORD=prodpass\r\n```\r\n\r\nThis was previously described in #988.\r\n"},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/97480996","html_url":"https://github.com/docker/compose/issues/1110#issuecomment-97480996","issue_url":"https://api.github.com/repos/docker/compose/issues/1110","id":97480996,"user":{"login":"kojiromike","id":1566303,"avatar_url":"https://avatars.githubusercontent.com/u/1566303?v=3","gravatar_id":"","url":"https://api.github.com/users/kojiromike","html_url":"https://github.com/kojiromike","followers_url":"https://api.github.com/users/kojiromike/followers","following_url":"https://api.github.com/users/kojiromike/following{/other_user}","gists_url":"https://api.github.com/users/kojiromike/gists{/gist_id}","starred_url":"https://api.github.com/users/kojiromike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kojiromike/subscriptions","organizations_url":"https://api.github.com/users/kojiromike/orgs","repos_url":"https://api.github.com/users/kojiromike/repos","events_url":"https://api.github.com/users/kojiromike/events{/privacy}","received_events_url":"https://api.github.com/users/kojiromike/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T16:01:53Z","updated_at":"2015-04-29T16:01:53Z","body":"Just a thought: What if instead of simply allowing you to specify an existing not-necessarily-docker service, compose would implicitly create an ambassador? This would allow docker and compose to continue to create the connection to the external service in a not-interface-breaking way."}}