version: "3" 
services:
  db:
    image: mysql:latest
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: MySQLRootPassword
      MYSQL_DATABASE: MySQLDatabaseName
      MYSQL_USER: MySQLUsername
      MYSQL_PASSWORD: MySQLUserPassword

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    restart: always
    ports:
      - "80:80"
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: MySQLUsername
      WORDPRESS_DB_PASSWORD: MySQLUserPassword
      WORDPRESS_DB_NAME: MySQLDatabaseName
    volumes:
      - "./:/var/www/html"

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - "8080:80"
    environment:
      PMA_HOST: db
      PMA_USER: MySQLUsername
      PMA_PASSWORD: MySQLUserPassword

volumes:
  mysql: {}


