version: '2'
services:
    postgres:
      image: postgres:9.5

    api:
      build: .
      links:
        - postgres
        - redis
      command: ./compose/django/gunicorn.sh
      env_file: .env
      volumes:
        - ./media:/app/funkwhale_api/media
        - ./staticfiles:/app/staticfiles
        - ./music:/music
      ports:
        - "127.0.0.1:6001:5000"

    redis:
      image: redis:3.0

    celeryworker:
      build: .
      env_file: .env
      links:
       - postgres
       - redis
      command: celery -A funkwhale_api.taskapp worker -l INFO
      volumes:
        - ./media:/app/funkwhale_api/media
        - ./music:/music
      environment:
        - C_FORCE_ROOT=True

    celerybeat:
      build: .
      env_file: .env
      links:
        - postgres
        - redis
      command: celery -A funkwhale_api.taskapp beat -l INFO
