services:

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

  application:
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
    image: matomo:{{applications.matomo.version}}
    ports:
      - "127.0.0.1:{{ports.localhost.http.matomo}}:80"
    volumes:
      - data:/var/www/html
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
    healthcheck:
      test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/localhost/80 && echo -e 'GET / HTTP/1.1\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n' >&3 && cat <&3 | grep -q 'HTTP/1.1'"]
      interval: 30s
      timeout: 10s
      retries: 3

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

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