services:

{% include 'roles/docker-oauth2-proxy/templates/container.yml.j2' %}

  application:
    image: dpage/pgadmin4:{{applications[application_id].version}}
    container_name: pgadmin
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
    ports:
      - "127.0.0.1:{{ports.localhost.http[application_id]}}:80"
{% include 'templates/docker/container/depends-on-just-database.yml.j2' %}
{% include 'templates/docker/container/networks.yml.j2' %}
    healthcheck:
      test: ["CMD", "wget", "--spider", "-q", "http://localhost:80/"]
      interval: 30s
      timeout: 10s
      retries: 3
    volumes:
      - "data:/var/lib/pgadmin"
{% if applications[application_id].server_mode | bool %}
      - "{{ pgadmin_host_server_file }}:{{ pgadmin_docker_server_file }}"
      - "{{ pgadmin_host_password_file }}:{{ pgadmin_docker_password_file }}"
{% endif %}

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

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