I’m creating a template yml file that to create wordpress sites on my QNAP NAS server. I have both Adminer and PHPMyAdmin in it and would usually remove one or the other. However, I ran it with both in there and got the error above and when I remove PMA it then gives the same error for WP-CLI just before it.
I’m new to Docker, but managed to get 9 sites up and running but realised I needed to add other tools to manage these sites, like PMA or Adminer.
Many thanks
Pete
#Site-wide
#
#Site name = -$sitename = xxx
#Database variables
#image type = -$database mariadb
#image version = -$dbversion latest
#MYSQL_ROOT_PASSWORD = -$dbrootpassword = xxx
#MYSQL_DATABASE = -$dbname $$sitename
#MYSQL_USER = -$dbuser xxx
#MYSQL_PASSWORD = -$dbpassword xxx
#Wordpress Variables
#
#Port = -$wpport 821
#Version = -$wpversion latest
#-------------------------------------------------------------------
version: "3.8"
services:
db:
image: $$database:$$dbversion
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
restart: unless-stopped
command:
[
"--default_authentication_plugin=mysql_native_password",
"--character-set-server=utf8mb4",
"--collation-server=utf8mb4_unicode_ci",
]
volumes:
#- ./wp-data:/docker-entrypoint-initdb.d
- .db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: $$dbrootpassword
MYSQL_DATABASE: $$dbname_db
MYSQL_USER: $$dbuser
MYSQL_PASSWORD: $$dbpassword
container_name: $$sitename_db
ports:
- $$wpport6:3306
adminer:
image: adminer:latest
container_name: $$sitename_adminer
restart: always
depends_on:
- db
links:
- db
ports:
- $$wpport5:8080
wordpress:
container_name: $$sitename_wordpress
image: wordpress:$$wpversion
restart: always
depends_on:
- db
ports:
- $$wpport0:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: $$dbuser
WORDPRESS_DB_NAME: $$dbname_db
WORDPRESS_DB_PASSWORD: $$dbpassword
volumes:
# our persistent local data re routing
- .:/var/www/html/wp-content/themes/testing:delegated
- ./plugins:/var/www/html/wp-content/plugins
- ./uploads:/var/www/html/wp-content/uploads
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
- ./php.ini:/usr/local/etc/php/conf.d/conf.ini
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
- ./theme-name/trunk/:/var/www/html/wp-content/themes/theme-name # Theme development
wpcli:
image: wordpress:cli
container_name: wpcli_app
volumes:
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini
- ./wp-app:/var/www/html
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_NAME: $$dbname
WORDPRESS_DB_USER: $$dbuser
WORDPRESS_DB_PASSWORD: $$dbpassword
depends_on:
- db
- wordpress
pma:
image: phpmyadmin:latest
container_name: pma
restart: unless-stopped
environment:
#https://docs.phpmyadmin.net/en/latest/setup.html#docker-environment-variables
PMA_HOST: db
PMA_PORT: $$wpport6:80
MYSQL_ROOT_PASSWORD: $$dbrootpassword
UPLOAD_LIMIT: 100M
VIRTUAL_HOST: phpmyadmin.$$sitename.test
LETSENCRYPT_HOST: phpmyadmin.$$sitename.test
links:
- db:db
volumes:
db:
wordpress: