Setup WordPress and MariaDB containers
Added port forwarding, python-docker (for Ansible), and containers.
This commit is contained in:
parent
497edc66ad
commit
9158e1184f
1
Vagrantfile
vendored
1
Vagrantfile
vendored
@ -3,6 +3,7 @@
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.vm.box = "debian/buster64"
|
||||
config.vm.network "forwarded_port", host: 8080, guest: 8080
|
||||
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||
|
||||
# Machine Name
|
||||
|
@ -31,5 +31,10 @@
|
||||
state: present
|
||||
force_apt_get: true
|
||||
|
||||
- name: 'Install Ansible dependency: python-docker'
|
||||
apt:
|
||||
name: python-docker
|
||||
|
||||
roles:
|
||||
- docker
|
||||
- wordpress
|
||||
|
26
roles/wordpress/tasks/main.yml
Normal file
26
roles/wordpress/tasks/main.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user