services:
  db:
    image: postgres:15-bullseye
    volumes:
      - ./initdb.d:/docker-entrypoint-initdb.d
      - db-data:/var/lib/postgresql/data
    command:
      - "--max_prepared_transactions=100"
    ports:
      - "127.0.0.1:5432:5432"
    environment:
      - POSTGRES_PASSWORD=supersecretpassword
      - TZ="Europe/Moscow"

  eks-backend:
    image: ${IMAGE:-eks-app:latest}
    depends_on:
      - db
    entrypoint: ["java", "-jar", "/home/app/backend.jar"]
    environment:
      - TZ="Europe/Moscow"
      - CONFIG_DATA_EXECUTOR_URL=http://eks-cde:8080/api
    env_file:
      - eks.env

  eks-frontend:
    image: ${IMAGE:-eks-app:latest}
    depends_on:
      - eks-backend
    ports:
      - "127.0.0.1:8080:80"
    entrypoint: ["nginx", "-g", "daemon off;"]
    environment:
      - TZ="Europe/Moscow"

  eks-cde:
    image: ${IMAGE:-eks-app:latest}
    entrypoint: ["java", "-jar", "/home/app/cde.jar"]
    volumes:
      - ./cde-xml:/cde-xml
    environment:
      - CONFIGDIRECTORY=/cde-xml

volumes:
   db-data:
