version: '3'
services:
  neo4j:
      image: neo4j:3.3.0
      container_name: neo4j_amundsen
      environment:
        - NEO4J_AUTH=neo4j/test
      ulimits:
        nofile:
          soft: 40000
          hard: 40000
      ports:
          - 7474:7474
          - 7687:7687
      volumes:
          - ./example/docker/neo4j/conf:/conf
          - ./example/docker/neo4j/plugins:/plugins
          - ./example/backup:/backup          
      networks:
        - amundsennet
  elasticsearch:
      image: elasticsearch:6.7.0
      container_name: es_amundsen
      ports:
          - 9200:9200
# TODO - tried mounting ES data outside the volume. 
# Not confident I did it right, I saw it acting up on restarts, plz halp!
#      volumes:
#          - ./example/docker/es_data:/usr/share/elasticsearch/data
      networks:
        - amundsennet
  amundsensearch:
      image: amundsendev/amundsen-search:1.4.1
      container_name: amundsensearch
      ports:
        - 5001:5000
      depends_on:
        - elasticsearch
      networks:
        - amundsennet
      environment:
        - PROXY_ENDPOINT=es_amundsen
      command: gunicorn -w 2 --bind :5000 search_service.search_wsgi
  amundsenmetadata:
      image: amundsendev/amundsen-metadata:1.1.2
      container_name: amundsenmetadata
      depends_on:
        - neo4j
      ports:
        - 5002:5000
      networks:
        - amundsennet
      environment:
         - PROXY_HOST=bolt://neo4j_amundsen
      command: gunicorn -w 2 --bind :5000 metadata_service.metadata_wsgi
  amundsenfrontend:
      image: amundsendev/amundsen-frontend:1.1.0
      container_name: amundsenfrontend
      depends_on:
        - amundsenmetadata
        - amundsensearch
      ports:
        - 5000:5000
      networks:
        - amundsennet
      environment:
        - SEARCHSERVICE_BASE=http://amundsensearch:5000
        - METADATASERVICE_BASE=http://amundsenmetadata:5000
        # Only for easy config-less Quickstart bookmark evalutation. `TestConfig` extends ordinary `LocalConfig` by
        # defining `AUTH_USER_METHOD` to a hardcoded dummy user in `amundsen_application.tests.test_utils.get_test_user()`
        # See further docs in https://github.com/lyft/amundsenfrontendlibrary/blob/master/docs/configuration.md#flask
        # and https://github.com/lyft/amundsenfrontendlibrary/blob/master/docs/configuration.md#authentication
        - FRONTEND_SVC_CONFIG_MODULE_CLASS=amundsen_application.config.TestConfig
      command: gunicorn -w 2 --bind :5000 amundsen_application.wsgi

networks:
  amundsennet:
