version: '3.8'

services:

  wordpress:
    image: wordpress:apache
    ports:
      - "8080:80"
    volumes:
      - ./data/wordpress:/var/www/html
    environment:
      - WORDPRESS_DB_HOST=mysql
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=wordpress
      - WORDPRESS_DB_NAME=wordpress
    depends_on:
      - mysql
    restart: unless-stopped

  mysql:
    image: mysql:8
    volumes:
      - ./data/mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=wordpress
      - MYSQL_PASSWORD=wordpress
    restart: unless-stopped
