MediaWiki-Docker/Configuration recipes/Example docker-compose.override.yml file

From mediawiki.org

Example docker-compose.override.yml file[edit]

Below is a complete override file that provides a Redis and ElasticSearch containers, along with overriding the user mapping and the XDebug configuration for the app container.

version: '3.7'
services:
  mediawiki:
    # On Linux, these lines ensure file ownership is set to your host user/group
    user: "${MW_DOCKER_UID}:${MW_DOCKER_GID}"
    environment:
      # On Linux, replace "yourhostname" with the output of `hostname`
      XDEBUG_CONFIG: remote_host=yourhostname
    # On Linux, uncomment the next 2 lines so Xdebug configuration
    # can access host.docker.internal:
    #extra_hosts:
    #  - "host.docker.internal:host-gateway"

  mediawiki-web:
    # On Linux, these lines ensure file ownership is set to your host user/group
    user: "${MW_DOCKER_UID}:${MW_DOCKER_GID}"


  # Note, adding a redis service requires changes to LocalSettings.php to work.
  redis:
    image: redis

  # Note, adding an elasticsearch service requires changes to LocalSettings.php to work.
  elasticsearch:
    image: elasticsearch:6.8.2
    environment:
      - discovery.type=single-node
    ports:
      - '9200:9200'
      - '9300:9300'
    volumes:
      - esdata:/usr/share/elasticsearch/data

volumes:
  esdata:
    driver: local