version: '3'
services:
  web:
    build:
      context: .
      args:
        CSENTRY_BUILD: DEV
    environment:
      LOCAL_SETTINGS: /app/settings.cfg
      FLASK_APP: /app/wsgi.py
      FLASK_DEBUG: 1
    command: flask run --host 0.0.0.0 --port 8000
    ports:
      - "8000:8000"
    volumes:
      - .:/app
  worker:
    environment:
      LOCAL_SETTINGS: /app/settings.cfg
      FLASK_APP: /app/wsgi.py
    volumes:
      - .:/app
  postgres:
    ports:
      - "5432:5432"
    volumes:
      - ./postgres/create-test-db.sh:/docker-entrypoint-initdb.d/create-test-db.sh
      - ${PGDATA_VOLUME}:/var/lib/postgresql/data/pgdata
  elasticsearch:
    volumes:
      - ${ELASTIC_DATA_VOLUME}:/usr/share/elasticsearch/data
    ports:
      - "9200:9200"
  kibana:
    image: docker.elastic.co/kibana/kibana:6.4.2
    ports:
      - "5601:5601"
    environment:
      - "ELASTICSEARCH_URL=http://csentry_elasticsearch:9200"
