version: '3.6' networks: {% if open_asfa_behind_haproxy %} haproxy-public: external: true {% endif %} {{ open_asfa_docker_network }}: volumes: {{ open_asfa_pgadmin_data_vol }}: {% if open_asfa_pgadmin_volume_type == "nfs4" %} driver: local driver_opts: type: {{ open_asfa_pgadmin_volume_type }} o: "{{ open_asfa_pgadmin_volume_o }}" device: "{{ open_asfa_pgadmin_volume_device }}" {% endif %} {{ open_asfa_db_volume }}: {% if open_asfa_pg_volume_type == "nfs4" %} driver: local driver_opts: type: {{ open_asfa_pg_volume_type }} o: "{{ open_asfa_pg_volume_o }}" device: "{{ open_asfa_pg_volume_device }}" {% endif %} services: pg: image: {{ open_asfa_db_image }} networks: - {{ open_asfa_docker_network }} volumes: - {{ open_asfa_db_volume }}:/var/lib/postgresql/data/pg_data - {{ open_asfa_compose_dir }}/pg-create-user-db.sh:/docker-entrypoint-initdb.d/pg-create-user-db.sh:ro environment: POSTGRES_PASSWORD: {{ open_asfa_db_pwd }} POSTGRES_DB: postgres POSTGRES_USER: postgres POSTGRES_PORT: {{ open_asfa_db_port }} PGDATA: /var/lib/postgresql/data/pg_data deploy: placement: {% if open_asfa_pg_volume_type == "nfs4" %} constraints: [node.role == worker] {% else %} constraints: {{ open_asfa_db_constraints }} {% endif %} restart_policy: condition: on-failure delay: 5s max_attempts: 3 window: 120s logging: driver: 'journald' pgadmin: image: {{ open_asfa_pgadmin_image }} networks: - {{ open_asfa_docker_network }} {% if open_asfa_behind_haproxy %} - haproxy-public {% endif %} volumes: - {{ open_asfa_pgadmin_data_vol }}:/var/lib/pgadmin - {{ open_asfa_compose_dir }}/pgadmin_config_local.py:/pgadmin4/config_local.py:ro - {{ open_asfa_compose_dir }}/pgadmin_servers.json:/pgadmin4/servers.json:ro environment: PGADMIN_DEFAULT_EMAIL: {{ open_asfa_pgadmin_email }} PGADMIN_DEFAULT_PASSWORD: {{ open_asfa_pgadmin_default_pwd }} PGADMIN_DISABLE_POSTFIX: disable #PGADMIN_ENABLE_TLS: enable PGADMIN_LISTEN_ADDRESS: 0.0.0.0 PGADMIN_LISTEN_PORT: 5050 GUNICORN_THREADS: 20 deploy: placement: {% if open_asfa_pgadmin_volume_type == "nfs4" %} constraints: [node.role == worker] {% else %} constraints: {{ open_asfa_pgadmin_constraints }} {% endif %} restart_policy: condition: on-failure delay: 5s max_attempts: 3 window: 120s logging: driver: 'journald'