This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
wordpress (deployment / containers)
Location: deployment/containers/wordpress/
Two playbooks that deploy WordPress with a MySQL database in containers: one for Docker, one for Podman. They are nearly identical in purpose; choose the runtime you use.
What they do
- Create a dedicated network (Docker or Podman).
- Create volumes for WordPress files and MySQL data.
- Start a MySQL 8.0 container (database).
- Wait ~15 seconds for MySQL to be ready.
- Start the WordPress container, connected to the DB and the same network.
- Expose WordPress on port 8080 (host) → 80 (container) by default.
Files
| File | Purpose |
|---|---|
| wordpress-docker-deployment.yml | Uses community.docker (docker_network, docker_volume, docker_container). |
| wordpress-podman-deployment.yml | Uses containers.podman (podman_network, podman_volume, podman_container). |
| README.md | In-repo notes on customising ports and credentials. |
What to change before running
-
Port – Default is
8080:80. Edit theports/publishmapping if 8080 is in use or you want another port. -
Database and WordPress env – Replace example credentials in both playbooks so they match:
WordPress container:
WORDPRESS_DB_HOST,WORDPRESS_DB_USER,WORDPRESS_DB_PASSWORD,WORDPRESS_DB_NAME
MySQL container:
MYSQL_DATABASE,MYSQL_USER,MYSQL_PASSWORD,MYSQL_RANDOM_ROOT_PASSWORD
Use strong, unique values; keep DB and WordPress env in sync.
Requirements
- Docker:
community.dockercollection; Docker daemon running. - Podman:
containers.podmancollection; Podman available.
How to run
Docker:
ansible-playbook -i localhost, deployment/containers/wordpress/wordpress-docker-deployment.yml
Podman:
ansible-playbook -i localhost, deployment/containers/wordpress/wordpress-podman-deployment.yml
Both playbooks target localhost with connection: local. They are not tested in this repo; run in a safe environment first.