I recently update my docker to the latest version (version 26.1.4, build 5650f9b), and I keep having issues with the my dockerized wordpress.
When I run my docker-compose, some CSS related to header and footer are not loading despite they are in my files.
I tried to replace MYSQL_ROOT_PASSWORD
with PMA_PASSWORD
and add PMA_USER
. I even tried to add a volumes: - db_data:/var/lib/mysql
to phpmyadmin
, however it keep telling me Error Establishing a Database Connection in WordPress
docker-compose.yml code:
version: '3.9'
services:
wordpress:
image: wordpress:php8.2
ports:
- "8888:80"
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
PHP_MEMORY_LIMIT: 256M
volumes:
- ./wordpress:/var/www/html
depends_on:
- db
db:
image: mysql:5.7.39
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
- ./db-init:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- "8080:80"
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: somewordpress
depends_on:
- db
volumes:
db_data: