
Path: /System/Library/Frameworks/amework/Versions/A/XPCServices/.xpc/Contents/MacOS/ How have you managed Docker local dev networking? Let me know in the comments below.Incident Identifier: 97E3AEB9-C93E-4D4F-82F9-79502614932D While the solution may have required a deeper knowledge of the Linux Kernel, it has yielded us a much simpler solution for developers. Local is always the fallback (127.0.0.1).Dev / Stg / Prod environments set the DB_HOST environment variable.We leverage this in multiple places in our settings.php, here is 1 example: $databases = getenv("DB_HOST") ?: '127.0.0.1' The following solution has also provided us with a consistent configuration fallback for local development. This also keeps the command docker-compose available if a developer is using an external project. # If you are on a Mac.Īlias dc='docker-compose -f 'Īlias dc='docker-compose -f 'Ī developer can then run all the usual Docker Compose commands with the shorthand dc command eg. Since we split out our Docker Compose file to be "per OS" we wanted to make it simple for developers to use these files.Īfter a couple of internal developers meetings, we came up with some bash aliases that developers only have to setup once. Split out the Docker Compose files into 2 separate files, making it simple for each OS can have its own approach.To facilitate this approach we had to make some trade offs: Meaning that you can interact on "localhost". # This makes the container run on the same network stack as your # We have to declare them here because these "sidecar" services are sharingĪll containers share the Network Namespace of the users' host, nothing else is required. # You will notice that we are forwarding port which do not belong to PHP. Port mapping for host to container "localhost".Mysql and Mail share the PHP containers Network Namespace, giving us "localhost" for "container to container" communication.Here are working examples for both OSX and Linux. However, if a container is created and told to share the same Network Namespace with an existing container, they will both be able to interface with each other on "localhost" or "127.0.0.1". Provided an IP on the default bridge network.Linux Network Namespaces allow for us to isolate processes into their own "network stacks".īy default, the following happens when a container gets created in Docker: If we wanted to access our local projects Solr, (inside and outside of container)Īll this can be achieved with Linux Network Namespaces in Docker Compose.


PhantomJS needs to know the domain of the site that you are running locally.PHP needs to know where PhantomJS is running.

