name: wbs-dev-test-services

networks:
  default:
    name: wbs-dev
    external: true

services:
  wikibase:
    image: wikibase/wikibase
    volumes:
      - wikibase-config:/config
      - wikibase-extensions:/var/www/html/extensions/extensions
      - ./LocalSettings.override.php:/var/www/html/LocalSettings.d/LocalSettings.override.php
      - ./empty.php:/var/www/html/LocalSettings.d/90_UserDefinedExtensions.php
      - ../${OUTPUT_DIR}:/var/log/mediawiki
    environment:
      MW_WG_SERVER: ${WIKIBASE_URL}
      QUICKSTATEMENTS_PUBLIC_URL: ${QUICKSTATEMENTS_URL}

  wikibase-jobrunner:
    image: wikibase/wikibase

  elasticsearch:
    image: wikibase/elasticsearch

  wdqs:
    image: wikibase/wdqs

  wdqs-updater:
    image: wikibase/wdqs
    environment:
      WIKIBASE_CONCEPT_URI: http://${WIKIBASE_PUBLIC_HOST}

  wdqs-frontend:
    image: wikibase/wdqs-frontend
    volumes:
      - wdqs-frontend-config:/config
    environment:
      WDQS_PUBLIC_URL: http://${WDQS_PUBLIC_HOST}/sparql
      WIKIBASE_PUBLIC_URL: http://${WIKIBASE_PUBLIC_HOST}/w/api.php

  quickstatements:
    image: wikibase/quickstatements
    environment:
      WIKIBASE_PUBLIC_URL: ${WIKIBASE_URL}
      QUICKSTATEMENTS_PUBLIC_URL: ${QUICKSTATEMENTS_URL}

  browser:
    image: ${TEST_BROWSER_IMAGE_URL}
    stop_grace_period: 1s
    ports:
      - 4444:4444
      - 5900:5900
      - 7900:7900
    volumes:
      # Should map to same location as wbs-dev-runner workspace root
      - ../../:/workspace
    shm_size: 2g
    environment:
      SE_NODE_MAX_SESSIONS: ${MAX_INSTANCES}
      SE_VNC_NO_PASSWORD: 1

  traefik:
    command:
      # Basic setup
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      # http endpoint
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.asdefault"
    networks:
      default:
        aliases:
          - ${WIKIBASE_PUBLIC_HOST}
          - ${WDQS_PUBLIC_HOST}

volumes:
  wikibase-config:
  wdqs-frontend-config:
  wikibase-extensions:
