WordPress is a web content management system. It was originally created as a tool to publish blogs but has evolved to support publishing other web content, including more traditional websites, mailing lists and Internet forum, media galleries, membership sites, learning management systems and online stores.
Publish port on the host for external access
Host Path
for Wordpress Data Storage and Wordpress Maria DB Storageservices:
wordpress:
image: wordpress
container_name: wordpress
restart: unless-stopped
ports:
- 8081:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- ./wordpress:/var/www/html
db:
image: mysql:8.0
restart: unless-stopped
container_name: wordpress-db
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- ./db:/var/lib/mysql
You can deploy as many of these containers as you want for each website you want to host. Be sure to change the external port and the container names for each one.
The install process is straight forward. In order to secure your Wordpress site, remove all the default themes and plugins, adding back in only what you need. Also make sure to enable automatic updates for any themes or plug-ins you install.
To run Wordpress behind a reverse proxy, go into the settings and change the URLs to your FQDN.
If you are using Umami to monitor web traffic, install the Umami plugin.
Navigate to Plugins > Add New Plugin > Search Plugins
Navigate to plugins > Integrate Umami > Settings
Use the information about the website you add to Umami to fill in this information: