version: "3"
services:
  db:
    image: mysql:5.7
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - db:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: rootpassword
      MYSQL_DATABASE: wp_zype_plugin_dev
      MYSQL_USER: wp_zype_plugin_dev_admin
      MYSQL_PASSWORD: password
    ports:
      - "3306:3306"
    expose:
      - "3306"
  wordpress:
    depends_on:
      - db
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8000:80"
    restart: always
    volumes:
      - wordpress/:/var/www/html
      - ./:/var/www/html/wp-content/plugins/zype-plugin
    environment:
      WORDPRESS_ENV: development
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wp_zype_plugin_dev_admin
      WORDPRESS_DB_PASSWORD: password
      WORDPRESS_DB_NAME: wp_zype_plugin_dev
      XDEBUG_CONFIG: remote_host=host.docker.internal

volumes:
  wordpress:
  db:
