Я думаю, что проблема со ссылкой:
WORDPRESS_DB_HOST: db:3306
version: '2'
services:
db:
image: mysql:5.7
ports:
- 3306:3306
restart: always
volumes:
#- db_data:/var/lib/mysql
- ./mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: password
networks:
- back
phpmyadmin:
volumes:
- ./php.ini:/usr/local/etc/php/php.ini
depends_on:
- db
image: phpmyadmin/phpmyadmin:4.7
restart: always
ports:
- 8080:80
environment:
PMA_HOST: db
MYSQL_ROOT_PASSWORD: password
networks:
- back
wordpress:
depends_on:
- db
image: wordpress:latest
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_NAME: wordpress
MYSQL_ROOT_PASSWORD: password
ports:
- 80:80 # Expose http and https
- 443:443
networks:
- back
networks:
back:
volumes:
db_data: