Docker Host Centos 7 Docker Images 6.x Ansible v2.0.2.0
To run the playbook:
- Edit the
ansible/hosts
inventory file to include the names or URLs of the servers you want to deploy. - Set ENV parameter in
ansible/playbook.yml
toENV=php-fpm
orENV=apache
in depending on stack which to use: lamp or lemp. By default this value is set toENV=php-fpm
to use PHP-FPM. - Set server_hostname in
ansible/playbook.yml
Run the playbook using:
ansible-playbook -i /ansible/hosts ansible/playbook.yml
You can deploy docker manually without ansible:
- Install docker on host VM
- Download repository with Dockerfiles
- Build images:
- MySQL: docker build -t="mysql-img" docker/mysql
- php-fpm: docker build -t="php-fpm-img" docker/php-fpm
- nginx: docker build -t="nginx-img" docker/nginx
- proftpd: docker build -t ="proftpd-img" docker/proftpd
- Run containers one by one:
- MySQL: docker run --name mysql mysql-img
- php-fpm: docker run -e ENV=php-fpm --link mysql --volumes-from mysql --name php-fpm php-fpm-img You can use Apache instead of PHP-FPM just set it to: ENV=apache
- nginx: docker run -p 443:443 -p 80:80 -e ENV=php-fpm --link php-fpm --volumes-from php-fpm --name nginx nginx-img Here you also need to set proper ENV, it should match to ENV from poing 2.
- proftpd: docker run --net=host --volumes-from php-fpm --name proftpd proftpd-img