version: "2"

services:
  wordpress:
    image: "chriszarate/wordpress:4.9.1"
    environment:
      VIRTUAL_HOST: "${DOCKER_DEV_DOMAIN}"
      WORDPRESS_ACTIVATE_PLUGINS: "papercite"
      WORDPRESS_SITE_TITLE: "Papercite test"
      WORDPRESS_SITE_URL: "http://${DOCKER_DEV_DOMAIN}"
      XDEBUG_CONFIG: "remote_host=${DOCKER_LOCAL_IP} idekey=xdebug"
    depends_on:
      - "mysql"
    networks:
      - "front"
      - "back"
    volumes:
      - ".:/var/www/html/wp-content/plugins/papercite"

  mysql:
    image: "mariadb:10.2"
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
      MYSQL_DATABASE: "wordpress"
      MYSQL_ROOT_PASSWORD: ""
    networks:
      - "back"

  proxy:
    image: "jwilder/nginx-proxy:alpine"
    ports:
      - "80:80"
    networks:
      front:
        aliases:
          - "${DOCKER_DEV_DOMAIN}"
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock:ro"

networks:
  front: {}
  back: {}
