version: '3.8'
services:
  postgres:
    image: postgres:11.16
    ports:
      - '5432:5432'   
    volumes:
      - ./srv/postgres/data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: atlasdb
      POSTGRES_USER: user
      POSTGRES_PASSWORD: parol
    healthcheck:
 #    test: ["CMD-SHELL", "pg_isready -U atlasdb -h 127.0.0.1"]
      test: [ "CMD", "pg_isready", "-q", "-d", "atlasdb", "-U", "user" ]
      interval: 10s
      timeout: 5s
      retries: 3
    restart: unless-stopped
    deploy:
      mode: replicated
      replicas: 1
      endpoint_mode: vip
      placement:
        max_replicas_per_node: 1
        constraints:
          - node.hostname == template


  confluence:
    image: atlassian/confluence:7.13.7
    ports:
      - '8090:8090'
    volumes:
      - './srv/conf:/var/atlassian/application-data/confluence'
    environment:
      JVM_MINIMUM_MEMORY: 8G
      JVM_MAXIMUM_MEMORY: 8G
      ATL_JDBC_URL: jdbc:postgresql://172.0.0.1:5432/atlasdb
      ATL_JDBC_USER: user
      ATL_JDBC_PASSWORD: "parol"
      ATL_DB_TYPE: postgresql
      ATL_DB_DRIVER: org.postgresql.Driver
      ATL_DB_SCHEMA_NAME: public
      ATL_PROXY_NAME: conf.ofd2.kz
      ATL_PROXY_PORT: 443
      ATL_TOMCAT_SCHEME: https
      JAVA_OPTS: "-javaagent:/var/atlassian/application-data/confluence/atlassian-agent.jar"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8090/"]
      interval: 10s
      timeout: 5s
      retries: 3
    deploy:
      mode: replicated
      replicas: 1
      endpoint_mode: vip
      placement:
        max_replicas_per_node: 1
        constraints:
          - node.hostname == template


  jira:
    image: atlassian/jira-software
    volumes:
      - './srv/jira:/var/atlassian/application-data/jira'
    ports:
      - '8080:8080'
    environment:
      JVM_MINIMUM_MEMORY: 8G
      JVM_MAXIMUM_MEMORY: 8G
      ATL_JDBC_URL: jdbc:postgresql://172.0.0.1:5432/atlasdb
      ATL_JDBC_USER: user
      ATL_JDBC_PASSWORD: "parol"
      ATL_DB_TYPE: postgres72
      ATL_DB_DRIVER: org.postgresql.Driver
      ATL_DB_SCHEMA_NAME: public
      ATL_PROXY_NAME: jira.ofd2.kz
      ATL_PROXY_PORT: 443
      ATL_TOMCAT_SCHEME: https
      JAVA_OPTS: "-javaagent:/var/atlassian/application-data/jira/atlassian-agent.jar"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/"]
      interval: 10s
      timeout: 5s
      retries: 3
    deploy:
      mode: replicated
      replicas: 1
      endpoint_mode: vip
      placement:
        max_replicas_per_node: 1
        constraints:
          - node.hostname == template
      

