Docker is probably my favourite technology in terms of server-side setup. It allows a standard installation of Linux with a few package installs to become a hugely powerful server eliminating port conflicts if different sites need to be hosted on the same port. The number of WordPress sites can virtually be limitless depending on the server hardware and load requirements.
The next learning plan to build on Docker is to start implementing Kubernetes but I’ve not really had a need to do this and the servers I currently manage aren’t all on a stable fast network which would make such things viable. I’ve set it up in the past though and are familiar the differences between Docker swarms and Kubernetes clusters.
version: '3.1'
networks:
proxy:
external: true
services:
db:
container_name: ${appname}-db
image: mariadb:${sql_tag}
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${root_pass}
MYSQL_DATABASE: ${db_name}
MYSQL_USER: ${db_name}
MYSQL_PASSWORD: ${db_pass}
volumes:
- ./sql:/var/lib/mysql:rw
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
# ports:
# - 3302:3306
networks:
- proxy
wordpress:
container_name: ${appname}-wp
image: wordpress:${wp_tag}
restart: always
# ports:
# - 8080:80
environment:
WORDPRESS_DB_HOST: ${appname}-db:3306
WORDPRESS_DB_USER: ${db_name}
WORDPRESS_DB_PASSWORD: ${db_pass}
WORDPRESS_DB_NAME: ${db_name}
volumes:
- ./app:/var/www/html
- ./php.ini:/usr/local/etc/php/conf.d/custom.ini:ro
networks:
- proxy
# links:
# - db
depends_on:
- db