ansible-role-open-asfa-test/templates/open-asfa-db-docker-compose...

110 lines
2.8 KiB
Plaintext
Raw Normal View History

2021-03-15 18:49:28 +01:00
version: '3.6'
networks:
{% if open_asfa_behind_haproxy %}
haproxy-public:
external: true
{% endif %}
{{ open_asfa_docker_network }}:
volumes:
{{ open_asfa_pgadmin_data_vol }}:
2023-06-03 14:23:39 +02:00
{% 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 %}
2021-03-15 18:49:28 +01:00
2023-06-03 14:47:47 +02:00
secrets:
open_asfa_test_pgadmin_config:
external: true
open_asfa_test_pgadmin_servers:
external: true
open_asfa_test_pg_config:
external: true
2021-03-15 18:49:28 +01:00
services:
pg:
image: {{ open_asfa_db_image }}
networks:
- {{ open_asfa_docker_network }}
volumes:
- {{ open_asfa_db_volume }}:/var/lib/postgresql/data/pg_data
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
2023-06-03 14:47:47 +02:00
secrets:
- source: open_asfa_test_pg_config
target: /docker-entrypoint-initdb.d/pg-create-user-db.sh
mode: 0555
2021-03-15 18:49:28 +01:00
deploy:
placement:
2023-06-03 14:23:39 +02:00
{% if open_asfa_pg_volume_type == "nfs4" %}
constraints: [node.role == worker]
{% else %}
2021-03-15 18:49:28 +01:00
constraints: {{ open_asfa_db_constraints }}
2023-06-03 14:23:39 +02:00
{% endif %}
2023-06-03 15:12:43 +02:00
2021-03-15 18:49:28 +01:00
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
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
2023-06-03 14:47:47 +02:00
secrets:
2023-06-03 15:16:14 +02:00
- source: open_asfa_test_pgadmin_config
2023-06-03 14:47:47 +02:00
target: /pgadmin4/config_local.py
mode: 0444
2023-06-03 15:16:14 +02:00
- source: open_asfa_test_pgadmin_servers
2023-06-03 14:47:47 +02:00
target: /pgadmin4/servers.json
mode: 0444
2021-03-15 18:49:28 +01:00
deploy:
placement:
2023-06-03 14:23:39 +02:00
{% if open_asfa_pgadmin_volume_type == "nfs4" %}
constraints: [node.role == worker]
{% else %}
2021-03-15 18:49:28 +01:00
constraints: {{ open_asfa_pgadmin_constraints }}
2023-06-03 14:23:39 +02:00
{% endif %}
2023-06-03 15:12:43 +02:00
2021-03-15 18:49:28 +01:00
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
logging:
driver: 'journald'