mglaman / platform-docker

Local development tool for PHP platforms using Docker Compose
GNU General Public License v2.0
46 stars 15 forks source link

Expose ports to host #65

Closed isholgueras closed 7 years ago

isholgueras commented 7 years ago

When running docker natively, in Ubuntu 16.04, ports like 80, 443 or even 3306 should be exposed to hosts to allow access from outside.

I don't know if this change could break the virtual machine configuration in Mac.

I also don't know if blackfire port should be exposed or not.

mglaman commented 7 years ago

We shouldn't expose Blackfire. I think maybe this should be a command option. I'll run about three projects at once with this, so I do not use mapping.

Instead, that's why there is the proxy command. This launches https://github.com/jwilder/nginx-proxy

It'll allow you to visit mysite.platform and it'll map port 80 to proper docker port. Only issue I've noticed is on Drupal 8 it can causes nginx->php timeouts, because the disk operations in Docker for Mac suck.

Can you give the proxy thing a go and see if that's fine? Otherwise I'd be OK adding a command to say "do you want to map ports directly" or somekind of verbiage like that

isholgueras commented 7 years ago

Thanks Matt, I didn't know the utility of proxy. Works fine for me.

You can close or reject this PR.

mglaman commented 7 years ago

Cool, I'll close. I also think proxy is better approach than direct port mapping.. because then you need to remember to shut down an environment to open a new one. Which is a pain, in my opinion, because life never lets you work on one without interuption :)