services:
  alert-client-db:
    container_name: alert-client-db
    image: postgres:16
    restart: unless-stopped
    ports:
      - 15432:5432
    environment:
      - POSTGRES_USER=default_user
      - POSTGRES_PASSWORD=default_pw
      - POSTGRES_DB=default_db
    volumes:
      - db-data:/var/lib/postgresql/data
    networks:
      - alert-client-net
  alert-client:
    container_name: alert-client
    build:
      context: .
      dockerfile: Dockerfile
    deploy:
      resources:
        limits:
          cpus: '2.0'
        reservations:
          cpus: '0.5'
    user: "0:0"
    entrypoint: ["/exec/runClient.sh", "-c"]
    restart: unless-stopped
    ports:
      - 8088:8080
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"    
    volumes:
      - ./log:/log
      - ./exec:/exec
      - ./keys:/keys
      #- ./exec/runClient.sh:/app/runClient.sh
      - /:/hostfs:ro
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
    networks:
      - alert-client-net
volumes:
  db-data:

networks:
  alert-client-net:
    driver: bridge
