Setup WordPress and MariaDB containers

Added port forwarding, python-docker (for Ansible), and containers.
This commit is contained in:
Kris Lamoureux 2019-09-19 18:22:51 -04:00
parent 497edc66ad
commit 9158e1184f
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 32 additions and 0 deletions

1
Vagrantfile vendored
View File

@ -3,6 +3,7 @@
Vagrant.configure("2") do |config| Vagrant.configure("2") do |config|
config.vm.box = "debian/buster64" config.vm.box = "debian/buster64"
config.vm.network "forwarded_port", host: 8080, guest: 8080
config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.synced_folder ".", "/vagrant", disabled: true
# Machine Name # Machine Name

View File

@ -31,5 +31,10 @@
state: present state: present
force_apt_get: true force_apt_get: true
- name: 'Install Ansible dependency: python-docker'
apt:
name: python-docker
roles: roles:
- docker - docker
- wordpress

View File

@ -0,0 +1,26 @@
- name: Start MariaDB container
docker_container:
name: mariadb
image: mariadb:10.4.8
restart_policy: always
volumes: mariadb:/var/lib/mysql
env:
MYSQL_RANDOM_ROOT_PASSWORD: "true"
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: Password1
- name: Start WordPress container
docker_container:
name: wordpress
image: wordpress:5.2.3
restart_policy: always
ports: 8080:80
volumes: wordpress:/var/www/html
links:
- mariadb
env:
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: Password1
WORDPRESS_DB_HOST: mariadb