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

  application:
    image: "{{ PIXELFED_IMAGE }}:{{ PIXELFED_VERSION }}"
    container_name: {{ PIXELFED_CONTAINER }}
{% include 'roles/docker-container/templates/base.yml.j2' %}
    volumes:
      - "data:/var/www/storage"
      - "./env:/var/www/.env"
    ports:
      - "127.0.0.1:{{ 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_CONTAINER }}
    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' %}