version: "3.7"

services:

  app:
    image: kavrakilab/omplapp
    environment:
      &env
      - OMPL_BROKER_URL=amqp://broker:5672
      - OMPL_BACKEND_URL=rpc://broker:5672
      - PYTHONPATH=/usr/share/ompl/webapp
    entrypoint: ["uwsgi", "--ini", "/usr/share/ompl/webapp/wsgi.ini"]
    init: true
    ports:
      - "5000:5000"
    volumes:
      - benchmark-data:/tmp
    depends_on:
      - broker
      - worker
      - plannerarena
    restart: unless-stopped

  worker:
    image: kavrakilab/omplapp
    environment: *env
    init: true
    working_dir: /usr/share/ompl/webapp
    entrypoint: ["celery", "worker", "--app=omplweb.celery", "--queues=omplapp", "--concurrency=4", "--loglevel=INFO"]
    volumes:
      - benchmark-data:/tmp
    depends_on:
      - broker
    restart: unless-stopped

  plannerarena:
    image: kavrakilab/plannerarena
    init: true
    ports:
      - "8888:8888"
    volumes:
      - benchmark-data:/tmp
    restart: unless-stopped

  broker:
    hostname: broker
    image: rabbitmq:3
    init: true
    restart: unless-stopped

volumes:
  benchmark-data:
