version: '2.3'
services:
wordpress:
depends_on:
- db
image: wordpress
restart: always
volumes:
- ./src/html:/var/www/html
ports:
- 81:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: root
WORDPRESS_DB_NAME: wordpress
db:
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- ./db_data:/var/lib/mysql
ports:
- 3306:3306
environment:
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: root
MYSQL_RANDOM_ROOT_PASSWORD: '1'
phpmyadmin:
depends_on:
- db
image: phpmyadmin/phpmyadmin
restart: always
ports:
- 82:80
environment:
PMA_HOST: db