services:

{% include 'roles/docker-central-database/templates/services/' + database_type + '.yml.j2' %}

{% include 'templates/docker/services/redis.yml.j2' %}

  application:
    image: zknt/pixelfed:{{applications.pixelfed.version}}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
    volumes:
      - "data:/var/www/storage"
      - "./env:/var/www/.env"
    ports:
      - "{{ports.localhost.http[application_id]}}:80"
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
  worker:
    image: zknt/pixelfed:{{applications.pixelfed.version}}
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
    volumes:
      - "data:/var/www/storage"
      - "./env:/var/www/.env"
    entrypoint: /worker-entrypoint.sh
    healthcheck:
      test: php artisan horizon:status | grep running
      interval: 60s
      timeout: 5s
      retries: 1
{% include 'templates/docker/container/depends-on-database-redis.yml.j2' %}
      application:
        condition: service_started
{% include 'templates/docker/container/networks.yml.j2' %}

{% include 'templates/docker/compose/volumes.yml.j2' %}
  redis:
  data:

{% include 'templates/docker/compose/networks.yml.j2' %}