version: '3.2' networks: {{ epasmed_haproxy_public_net }}: external: true {{ epasmed_docker_network }}: volumes: {{ epasmed_attachments_volume }}: {% if epasmed_dockerized_db %} {{ epasmed_pg_backups_volume }}: {{ epasmed_db_volume }}: {% endif %} services: {{ epasmed_docker_service_server_name }}: image: {{ epasmed_docker_server_image }} environment: - _JAVA_OPTIONS=-Xmx512m -Xms256m - SPRING_PROFILES_ACTIVE=prod,swagger - MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true - APPLICATION_DATASOURCEEPASMED_DATASOURCE_URL=jdbc:postgresql://epasmed-postgresql:5432/epasmed - JHIPSTER_SLEEP=30 # gives time for other services to boot before the application ports: - 80:80 networks: - {{ epasmed_docker_network }} - {{ epasmed_haproxy_public_net }} volumes: - {{ epasmed_attachments_volume }}:/home/epasmed/epasmed/data/attachments - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro deploy: mode: replicated replicas: 1 endpoint_mode: dnsrr placement: constraints: - node.role == worker - {{ epasmed_node_constraints }} restart_policy: condition: on-failure delay: 5s max_attempts: 3 window: 120s logging: driver: 'journald' {% if epasmed_dockerized_db %} epasmed-postgresql: image: {{ epasmed_db_image }} environment: - POSTGRES_PASSWORD: {{ epasmed_db_pwd }} - POSTGRES_DB: epasmed - POSTGRES_USER: epasmed - POSTGRES_PORT: 5432 - POSTGRES_HOST_AUTH_METHOD=trust - PGDATA: /var/lib/postgresql/data/pg_data networks: - {{ epasmed_docker_network }} volumes: - {{ epasmed_pg_data_volume }}:/var/lib/postgresql/data/pg_data - {{ epasmed_pg_backups_volume }}:/tmp:ro - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone:ro deploy: mode: replicated replicas: 1 endpoint_mode: dnsrr placement: constraints: {{ epasmed_db_constraints }} restart_policy: condition: on-failure delay: 5s max_attempts: 3 window: 120s logging: driver: 'journald' {% endif %}