I’m trying to dockerize a multisite wordpress,but I can’t see what I did wrong.
I made a docker-compose file, when I run docker-compose up, volumes and containers are created and everything goes well, when I access the localhost:8085 all what I see is a blank page.
I tired deleting volumes, and tried building from the start but for some I always end up in the same situation.
This is my docker-compose file:
version: '3.3'
services:
db:
image: mysql:8
volumes:
- db_data:/var/lib/mysql
networks:
- wp-multisite
restart: always
environment:
DB_HOST: localhost
MYSQL_ROOT_HOST: '%'
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
ports:
- 3306:3306
phpmyadmin:
depends_on:
- db
image: 'phpmyadmin:latest'
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: password
ports:
- 8090:80
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- 8085:80
restart: always
volumes:
- ./wordpress:/var/www/html
- ./wordpress/.htaccess:/var/www/html/.htaccess
networks:
- wp-multisite
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress
WORDPRESS_DEBUG: 1
WORDPRESS_CONFIG_EXTRA: |
define('WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('WP_HOME', 'http://localhost');
define('WP_SITEURL', 'http://localhost');
define( 'NOBLOGREDIRECT', '' );
volumes:
db_data:
wordpress:
networks:
wp-multisite:
The wordpress container logs says this:
Could not reliably determine the server's fully qualified domain name, using xxxxxxx.
Set the 'ServerName' directive globally to suppress this message
WordPress database error Table 'wordpress.wp_blogs' doesn't exist
Thanks for the help!!