services:
  sphinx:
    build: ./dockerfiles/sphinx
    restart: always
    depends_on:
      - db
    command: sh -c 'searchd -c /etc/sphinxsearch/sphinx.conf & sleep 10 && while true; do indexer --rotate --all; sleep 7200; done'
    volumes:
      - ./config/sphinx:/etc/sphinxsearch
      - ./log/sphinx:/var/log/sphinxsearch
      - sphinx:/var/lib/sphinx/data
    expose:
      - "9306"

volumes:
  sphinx:
