ansible-role-inception/templates/inception-project-docker-co...

84 lines
2.6 KiB
Plaintext
Raw Normal View History

2021-01-07 20:34:41 +01:00
version: '3.6'
networks:
2021-11-02 19:47:36 +01:00
{% if not inception_pep %}
2021-01-07 20:34:41 +01:00
haproxy-public:
external: true
{% endif %}
{{ inception_project_docker_network }}:
volumes:
{{ inception_project_db_volume }}:
# {{ inception_project_service_volume }}:
services:
{{ inception_project_docker_service_name }}:
image: {{ inception_project_docker_image }}
networks:
- {{ inception_project_docker_network }}
2021-11-02 19:47:36 +01:00
{% if not inception_pep %}
2021-01-07 20:34:41 +01:00
- haproxy-public
{% endif %}
environment:
2021-11-03 18:21:15 +01:00
- INCEPTION_DB_DIALECT=org.hibernate.dialect.MariaDB103Dialect
- INCEPTION_DB_DRIVER=org.mariadb.jdbc.Driver
- INCEPTION_DB_URL=jdbc:mariadb://{{ inception_project_db_host }}:{{ inception_project_db_port }}/{{ inception_project_db_name }}?useUnicode=true&characterEncoding=UTF-8
2021-01-07 20:34:41 +01:00
- INCEPTION_DB_USERNAME={{ inception_project_db_user }}
- INCEPTION_DB_PASSWORD={{ inception_project_db_pwd }}
- VIRTUAL_HOST={{ inception_project_server_endpoint }}
2021-11-03 18:21:15 +01:00
- JAVA_OPTS=-Dspring.jpa.properties.hibernate.dialect.storage_engine=innodb
volumes:
2021-01-07 20:34:41 +01:00
volumes:
- {{ inception_project_service_volume }}:/export
depends_on:
- {{ inception_project_db_host }}
deploy:
mode: replicated
replicas: 1
{% if not inception_pep %}
2021-01-07 20:34:41 +01:00
endpoint_mode: dnsrr
{% endif %}
2021-01-07 20:34:41 +01:00
placement:
constraints:
- node.role == worker
- {{ inception_project_service_constraints }}
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
logging:
driver: 'journald'
{% if inception_project_db_as_container %}
{{ inception_project_db_host }}:
image: {{ inception_project_db_image }}
networks:
- {{ inception_project_docker_network }}
volumes:
- {{ inception_project_db_volume }}:/var/lib/mysql
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE={{ inception_project_db_name }}
- MYSQL_USER={{ inception_project_db_user }}
- MYSQL_PORT=3306
- MYSQL_PASSWORD={{ inception_project_db_pwd }}
command: ["--character-set-server=utf8", "--collation-server=utf8_bin"]
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-p{{ inception_project_db_pwd }}", "-u{{ inception_project_db_user }}"]
interval: 20s
timeout: 10s
retries: 10
deploy:
placement:
constraints:
- node.role == worker
- {{ inception_project_db_constraints }}
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
logging:
driver: 'journald'
{% endif %}