2020-10-13 18:33:16 +02:00
|
|
|
version: '3.6'
|
|
|
|
|
|
|
|
services:
|
|
|
|
{{ open_asfa_docker_service_server_name }}:
|
|
|
|
image: {{ open_asfa_docker_server_image }}
|
|
|
|
networks:
|
|
|
|
- {{ open_asfa_docker_network }}
|
|
|
|
depends_on:
|
2020-10-13 19:59:21 +02:00
|
|
|
- pg
|
2020-10-13 18:33:16 +02:00
|
|
|
environment:
|
|
|
|
SERVER_PORT: 8080
|
2020-10-13 19:59:21 +02:00
|
|
|
#DB_HOST: {{ open_asfa_docker_service_server_name }}_pg
|
|
|
|
DB_HOST: pg
|
2020-10-13 18:33:16 +02:00
|
|
|
DB_PORT: 5432
|
|
|
|
SCHEMA: {{ open_asfa_db_name }}
|
|
|
|
DB_USER: {{ open_asfa_db_user }}
|
|
|
|
DB_PASSWORD: {{ open_asfa_db_pwd }}
|
|
|
|
deploy:
|
|
|
|
mode: replicated
|
|
|
|
replicas: 1
|
|
|
|
endpoint_mode: dnsrr
|
|
|
|
placement:
|
|
|
|
constraints: [node.role == worker]
|
|
|
|
restart_policy:
|
2020-10-13 18:42:02 +02:00
|
|
|
condition: on-failure
|
2020-10-13 18:33:16 +02:00
|
|
|
delay: 5s
|
|
|
|
max_attempts: 3
|
|
|
|
window: 120s
|
|
|
|
logging:
|
|
|
|
driver: 'journald'
|
|
|
|
{{ open_asfa_docker_service_client_name }}:
|
|
|
|
image: {{ open_asfa_docker_client_image }}
|
|
|
|
networks:
|
|
|
|
- {{ open_asfa_docker_network }}
|
2020-10-14 17:37:39 +02:00
|
|
|
environment:
|
|
|
|
API_BASE_URL: http://{{ open_asfa_docker_service_server_name }}:8080
|
2020-10-13 18:33:16 +02:00
|
|
|
deploy:
|
|
|
|
mode: replicated
|
|
|
|
replicas: 1
|
|
|
|
endpoint_mode: dnsrr
|
|
|
|
placement:
|
|
|
|
constraints: [node.role == worker]
|
|
|
|
restart_policy:
|
2020-10-13 18:42:02 +02:00
|
|
|
condition: on-failure
|
2020-10-13 18:33:16 +02:00
|
|
|
delay: 5s
|
|
|
|
max_attempts: 3
|
|
|
|
window: 120s
|
|
|
|
logging:
|
|
|
|
driver: 'journald'
|
2020-10-13 19:59:21 +02:00
|
|
|
pg:
|
2020-10-13 18:33:16 +02:00
|
|
|
image: {{ open_asfa_db_image }}
|
|
|
|
networks:
|
|
|
|
- {{ open_asfa_docker_network }}
|
2020-10-14 15:41:17 +02:00
|
|
|
# ports:
|
|
|
|
# - 5432
|
2020-10-13 18:33:16 +02:00
|
|
|
volumes:
|
|
|
|
- {{ open_asfa_db_volume }}:/var/lib/postgresql/data/pg_data
|
2020-10-14 13:58:10 +02:00
|
|
|
- {{ open_asfa_compose_dir }}/pg-create-user-db.sh:/docker-entrypoint-initdb.d/pg-create-user-db.sh:ro
|
2020-10-13 18:33:16 +02:00
|
|
|
environment:
|
|
|
|
POSTGRES_PASSWORD: {{ open_asfa_db_pwd }}
|
|
|
|
POSTGRES_DB: postgres
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PORT: 5432
|
|
|
|
PGDATA: /var/lib/postgresql/data/pg_data
|
2020-10-13 18:39:41 +02:00
|
|
|
deploy:
|
|
|
|
placement:
|
|
|
|
constraints: {{ open_asfa_db_constraints }}
|
|
|
|
restart_policy:
|
2020-10-13 18:42:02 +02:00
|
|
|
condition: on-failure
|
2020-10-13 18:39:41 +02:00
|
|
|
delay: 5s
|
|
|
|
max_attempts: 3
|
|
|
|
window: 120s
|
|
|
|
logging:
|
|
|
|
driver: 'journald'
|
2020-10-13 18:33:16 +02:00
|
|
|
|
|
|
|
networks:
|
|
|
|
{{ open_asfa_docker_network }}:
|
|
|
|
|
|
|
|
volumes:
|
2020-10-13 18:39:41 +02:00
|
|
|
{{ open_asfa_db_volume }}:
|