{% include 'roles/docker-compose/templates/base.yml.j2' %}

  application:
    image: "{{ pixelfed_image }}:{{ pixelfed_version }}"
    container_name: {{ pixelfed_name }}
{% include 'roles/docker-container/templates/base.yml.j2' %}
    volumes:
      - "data:/var/www/storage"
      - "./env:/var/www/.env"
    ports:
      - "{{ports.localhost.http[application_id]}}:80"
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
  worker:
    container_name: {{ pixelfed_worker_name }}
    image: "{{ pixelfed_image }}:{{ pixelfed_version }}"
{% include 'roles/docker-container/templates/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 'roles/docker-container/templates/depends_on/dmbs_incl.yml.j2' %}
      application:
        condition: service_started
{% include 'roles/docker-container/templates/networks.yml.j2' %}

{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
  data:
    name: {{ pixelfed_volume }}

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