enonic/apache2
Standard apache2 container based on ubuntu exposes /etc/apache2, /etc/ssl, /var/www/html as volumes and port 80 and 443 as tcp ports.
docker run -d --name frontend-storage enonic/apache2 echo "frontend storage"
docker wait frontend-storage
docker run -d --name frontend -p 80:80 -p 443:443 --volumes-from frontend-storage -h www.example.com enonic/apache2
docker run -d --name frontend -p 80:80 -p 443:443 --volumes-from frontend-storage -h www.example.com enonic/apache2
docker exec frontend gen_proxy_conf <remote server adress>:<remote server port> <host name>
docker exec frontend rm_vhost_conf <hostname>
docker exec frontend reload_apache2
docker exec frontend apache2ctl restart
docker exec frontend apache2ctl -t
This command syncs files to the containers htdocs ( /var/www/html ). Example command here:
docker run -it --rm --name frontend-static-file-sync -v /tmp/static-files-target:/newfiles --volumes-from frontend-storage -h frontend.enonic.io enonic/apache2 sync_static_files
docker run -it --rm --name frontend-shell--volumes-from frontend-storage -h www.example.com enonic/apache2 bash
All vhost configurations than connects to a linked container has to be generated at startup. This means that for every vhost, we create a template that will be transformed on startup by the launcher script. To generate a templete for the domain, simply run the gen_linking_proxy_conf <domain name>
command eiter by docker exec or trough shell access to the persistant storage volume
Create vhost template
docker exec frontend gen_linking_proxy_conf <servername>
Delete vhost template
docker exec frontend rm_linking_proxy_conf
docker pull enonic/apache2