webdevops / php-docker-boilerplate

:stew: PHP Docker Boilerplate for Symfony, Wordpress, Joomla or any other PHP Project (NGINX, Apache HTTPd, PHP-FPM, MySQL, Solr, Elasticsearch, Redis, FTP)
https://webdevops.io/projects/php-docker-boilerplate/
MIT License
562 stars 186 forks source link

Port 80 and 443 #59

Closed mpastas closed 7 years ago

mpastas commented 7 years ago

Is there any configuration to expose the port 80 and 443?

I've tried with docker compose:

ports:
  - "80:80"
  - "443:443"
mblaschke commented 7 years ago

Should be working without problems, what are you using as Docker host?

mpastas commented 7 years ago

Hi Markus, Virtualbox on Mac.

mblaschke commented 7 years ago

Any error message? Please keep in mind that the exposed port is only available on the VM, not on the mac.

mpastas commented 7 years ago

Right, so it is working there and I would like to expose it on the mac with the port 80, is there any chance to do it using the configs?

mblaschke commented 7 years ago

Not on docker scope because docker can only control the host on which it is running (the linux host).

If you want it on the mac use the port mapping/forwarding from your virtualization.

mpastas commented 7 years ago

What about a Linux OS? Same results in there..

mblaschke commented 7 years ago

Docker only exposes the port on the linux host where Docker is running so it depends if you're running Docker on the bare metal host (port is available directly on 127.0.0.1) or in a virtualization (same problem) :)

mblaschke commented 7 years ago

If docker (running in a VM) would have access to your macOS this would be a real security issue if it can control the OS outside of the virtualization ;)

mpastas commented 7 years ago

:D Got it! thanks for the quick responses!

mblaschke commented 7 years ago

You're welcome :)