Skip to content

Commit

Permalink
Add host.docker.internal to docker-compose.yml
Browse files Browse the repository at this point in the history
This should ensure that we can use host.docker.internal to connect to
the host machine from within a container irrespective of the OS on the
host machine.

The host.docker.internal address is automatically available to Docker
Desktop[1] on Windows and Mac, but not on Linux without this additional
configuration[2].

[1]: https://docs.docker.com/desktop/features/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host
[2]: docker/for-linux#264 (comment)
  • Loading branch information
chrisroos committed Feb 10, 2025
1 parent 9445fed commit 6e576b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ services:
- POSTGRES_DB
- POSTGRES_PASSWORD
- POSTGRES_USER
extra_hosts:
- "host.docker.internal:host-gateway"
smee:
image: deltaprojects/smee-client
platform: linux/amd64
Expand Down

0 comments on commit 6e576b3

Please sign in to comment.