This docker image contains an Apache Httpd Server with proxy enabled, actually following modules are enabled :
mod_proxy
rewrite
headers
Then the container contains two directries :
Imagine you are building a Wordpress site, you may have to use a container for Wordpress execution, that use a MySql Database (in another container), and for administering the database you want to use a phpmyadmin (in a container), so you will have at leat 3 containers :
For executing all those containers you may use command like that :
docker run -d --name mysql mysql-container-image
docker run -d -p 8080:80 --link mysql:mysql --name phpmyadmin phpmyadmin-container-image
docker run -d -p 80:80 --link mysql:mysql --name wordpress wordpress-docker-image
The "Apache Reverse Proxy" container will allow you to put all those containers behind a proxy. In order to do that, you will have to create a new docker image (with a new Dockerfile), create a proxy.conf file, and then build your proxy.
Dockerfile:
FROM rgoyard/apache-proxy:latest
MAINTAINER Your Name <[email protected]>
ADD proxy.conf /conf/
Then you need to create a proxy.conf file with the following lines
ProxyPass / http://wordpress/
ProxyPass /phpmyadmin http://phpmyadmin/
And you are ready to build and run your proxy
docker build -t company/project-name:version .
Now run it :
docker run -d --name mysql mysql-container-image
docker run -d --link mysql:mysql --name phpmyadmin phpmyadmin-container-image
docker run -d --link mysql:mysql --name wordpress wordpress-docker-image
docker run -d -p 80:80 --link wordpress:wordpress --link phpmyadmin:phpmyadmin --name myProject company/project-name:version
That's it !
Note : There is no need anymore to expose the "real" port of wordpress and phpmyadmin, as they are accessed from a reverse proxy
Of course you can use docker-compose (or fig) to create a full configuration file ...
Content type
Image
Digest
sha256:662c36679…
Size
54.6 MB
Last updated
over 11 years ago
docker pull rgoyard/apache-proxy