version: "3"

services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
    volumes:
      - "./wordpress/web:/var/www/html"
      - "./wordpress/nginx.conf:/etc/nginx/conf.d/default.conf"
    depends_on:
      - wordpress
  wordpress:
    image: wordpress:php7.1-fpm-alpine
    volumes:
      - "./wordpress/web:/var/www/html"
    depends_on:
      - mysql
  mysql:
      image: mysql:8
      environment:
        MYSQL_ROOT_PASSWORD: "wordpress"
        MYSQL_USER: "wordpress"
        MYSQL_PASSWORD: "wordpress"
        MYSQL_DATABASE: "wordpress"
      volumes:
        - "./wordpress/mysql:/var/lib/mysql"
  wp:
    image: wordpress:cli-php7.1
    volumes:
      - "./wordpress/web:/var/www/html"
      - "./wordpress/export:/export"