version: '3.1'
volumes:
  files:
    driver: local
    driver_opts: 
      type: volume 
      o: 'bind'
      device: "${MWIKI_ROOT}/www"
  es01:
    driver: local
    driver_opts: 
      type: volume 
      o: 'bind'
      device: "${MWIKI_ROOT}/es"


services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
    container_name: ${CONTAINER_PREFIX}_es
    restart: "no"
    ports:
      - 9255:9200
    volumes:
      - es01:/usr/share/elasticsearch/data

  parsoid:
    image: thenets/parsoid:0.11
    container_name: ${CONTAINER_PREFIX}_parsoid
    restart: "no"
    ports:
      - 8142:8000
    environment: 
      - PARSOID_DOMAIN_${PARSOID_DOMAIN_NAME}=http://${PARSOID_DOMAIN_NAME}/api.php 

  db:
    image: mysql
    container_name: ${CONTAINER_PREFIX}_mysql
    command: --default-authentication-plugin=mysql_native_password
    restart: "no"
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 
      - MYSQL_USER==${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}
    volumes: 
      - ${MWIKI_ROOT}/backups:/var/backups
      - ${MWIKI_ROOT}/data_dir:/var/lib/mysql

  mediawiki:
    image: laxaurus/mediawiki:1.2
    container_name: ${CONTAINER_PREFIX}
    restart: "no"
    ports:
      - 8055:80
    links:
      - db
      - parsoid
    volumes:
      - files:/var/www/html

