You can use any reverse proxy to do this.
You have one container for apache, one container for discourse (or one with both) and you do not expose any ports (do not use -p
). However, you might want to use the PORT
instruction if you are building the image via a dockerfile.
Once the containers are running, you should be able to access them via <ip container apache>:80
and <ip container discourse>:81
from the host.
Now you can start a new container with a reverse proxy. If you used PORT
, you can even link the containers (i.e. docker run -link <apache container name>:apache -link <discourse container name>:discourse
) in order to have the ips on the env.
You can use reverse proxies like apache, nginx or hipache.
When you run the reverse proxy container, you need to specify the -p 0.0.0.0:80:80
in order to have it available form outside the host.
Example of nginx config for reverse proxy using docker links: https://github.com/creack/prod/blob/master/nginx/nginx.conf#L27