services:
  db:
    image: mariadb:latest
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - ./wordpress_data/db_data:/var/lib/mysql
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=somewordpress
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=admin
      - MYSQL_PASSWORD=admin1234
    # expose:
    #   - 3306
    #   - 33060
    ports:
      - 3307:3306
  wordpress:
    image: wordpress:latest
    volumes:
      - ./wordpress_data/wp_data:/var/www/html
    ports:
      - 8000:80
    restart: always
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=admin
      - WORDPRESS_DB_PASSWORD=admin1234
      - WORDPRESS_DB_NAME=wordpress
  phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    restart: always
    ports:
    - "8080:80"
    environment:
      PMA_HOST: db
      PMA_USER: admin
      PMA_PASSWORD: admin1234

volumes:
  db_data:
  wp_data:
