services:
  # Main Application
  app:
    container_name: websocket-qris
    build:
      context: .
      dockerfile: Dockerfile
      target: prod
    restart: unless-stopped
    ports:
      - "8030:8030"
    environment:
      # Server Configuration
      APP_ENV: production
      PORT: 8030
      GIN_MODE: release

      # Default Database Configuration (PostgreSQL)
      DB_CONNECTION: postgres
      DB_USERNAME: simrs
      DB_PASSWORD: simrs.rssa
      DB_HOST: 10.10.123.163
      DB_DATABASE: simrs
      DB_PORT: 5432
      DB_SSLMODE: disable

      # # satudata Database Configuration (PostgreSQL)
      # POSTGRES_SATUDATA_CONNECTION: postgres
      # POSTGRES_SATUDATA_USERNAME: stim
      # POSTGRES_SATUDATA_PASSWORD: stim*RS54
      # POSTGRES_SATUDATA_HOST: 10.10.123.165
      # POSTGRES_SATUDATA_DATABASE: satu_db
      # POSTGRES_SATUDATA_PORT: 5432
      # POSTGRES_SATUDATA_SSLMODE: disable

      # # Mongo Database
      # MONGODB_MONGOHL7_CONNECTION: mongodb
      # MONGODB_MONGOHL7_HOST: 10.10.123.206
      # MONGODB_MONGOHL7_PORT: 27017
      # MONGODB_MONGOHL7_USER: admin
      # MONGODB_MONGOHL7_PASS: stim*rs54
      # MONGODB_MONGOHL7_MASTER: master
      # MONGODB_MONGOHL7_LOCAL: local
      # MONGODB_MONGOHL7_SSLMODE: disable

      # # MYSQL Antrian Database
      # # MYSQL_ANTRIAN_CONNECTION: mysql
      # # MYSQL_ANTRIAN_HOST: mysql_antrian
      # # MYSQL_ANTRIAN_USERNAME: www-data
      # # MYSQL_ANTRIAN_PASSWORD: www-data
      # # MYSQL_ANTRIAN_DATABASE: antrian_rssa
      # # MYSQL_ANTRIAN_PORT: 3306
      # # MYSQL_ANTRIAN_SSLMODE: disable

      # # MYSQL Medical Database
      # MYSQL_MEDICAL_CONNECTION: mysql
      # MYSQL_MEDICAL_HOST: 10.10.123.163
      # MYSQL_MEDICAL_USERNAME: meninjardev
      # MYSQL_MEDICAL_PASSWORD: meninjar*RS54
      # MYSQL_MEDICAL_DATABASE: healtcare_database
      # MYSQL_MEDICAL_PORT: 3306
      # MYSQL_MEDICAL_SSLMODE: disable

      # Keycloak Configuration
      # KEYCLOAK_ISSUER: https://auth.rssa.top/realms/sandbox
      # KEYCLOAK_AUDIENCE: nuxtsim-pendaftaran
      # KEYCLOAK_JWKS_URL: https://auth.rssa.top/realms/sandbox/protocol/openid-connect/certs
      # KEYCLOAK_ENABLED: "true"

      # BPJS Configuration
      # BPJS_BASEURL: https://apijkn.bpjs-kesehatan.go.id/vclaim-rest
      # BPJS_CONSID: 5257
      # BPJS_USERKEY: 4cf1cbef8c008440bbe9ef9ba789e482
      # BPJS_SECRETKEY: 1bV363512D

      # SatuSehat Configuration
      # BRIDGING_SATUSEHAT_ORG_ID: 100026555
      # BRIDGING_SATUSEHAT_FASYAKES_ID: 3573011
      # BRIDGING_SATUSEHAT_CLIENT_ID: l1ZgJGW6K5pnrqGUikWM7fgIoquA2AQ5UUG0U8WqHaq2VEyZ
      # BRIDGING_SATUSEHAT_CLIENT_SECRET: Al3PTYAW6axPiAFwaFlpn8qShLFW5YGMgG8w1qhexgCc7lGTEjjcR6zxa06ThPDy
      # BRIDGING_SATUSEHAT_AUTH_URL: https://api-satusehat.kemkes.go.id/oauth2/v1
      # BRIDGING_SATUSEHAT_BASE_URL: https://api-satusehat.kemkes.go.id/fhir-r4/v1
      # BRIDGING_SATUSEHAT_CONSENT_URL: https://api-satusehat.dto.kemkes.go.id/consent/v1
      # BRIDGING_SATUSEHAT_KFA_URL: https://api-satusehat.kemkes.go.id/kfa-v2

      # Swagger Configuration
      SWAGGER_TITLE: API Service QRIS
      SWAGGER_DESCRIPTION: Documentation SWAGGER API Service QRIS
      SWAGGER_VERSION: 2.0.0
      SWAGGER_CONTACT_NAME: Support Team
      SWAGGER_HOST: api.mycompany.com:8080
      SWAGGER_BASE_PATH: /api/v2
      SWAGGER_SCHEMES: https

      # API Configuration
      API_TITLE: API Service UJICOBA QRIS
      API_DESCRIPTION: Documentation SWAGGER
      API_VERSION: 3.0.0
      
      # WebSocket Configuration
      WS_READ_TIMEOUT: 300s
      WS_WRITE_TIMEOUT: 30s
      WS_PING_INTERVAL: 60s
      WS_PONG_TIMEOUT: 70s
      WS_HANDSHAKE_TIMEOUT: 45s
      WS_READ_BUFFER_SIZE: 8192
      WS_WRITE_BUFFER_SIZE: 8192
      WS_CHANNEL_BUFFER_SIZE: 512
      WS_MESSAGE_QUEUE_SIZE: 5000
      WS_MAX_MESSAGE_SIZE: 8192
      WS_QUEUE_WORKERS: 10
      WS_ACTIVITY_LOG_SIZE: 1000
      WS_CLEANUP_INTERVAL: 2m
      WS_INACTIVE_TIMEOUT: 5m
      WS_SERVER_ID: api-service-v1
      WS_ENABLE_COMPRESSION: "true"
      WS_ENABLE_METRICS: "true"
      WS_ENABLE_MONITORING: "true"
    # depends_on:
    #   psql_bp:
    #     condition: service_healthy
    #   mongodb:
    #     condition: service_started
    #   mysql_antrian:
    #     condition: service_healthy
    #   mysql_medical:
    #     condition: service_healthy
    networks:
      - goservice

# volumes:
#   postgres_data:
#   mongodb_data:
#   mysql_antrian_data:
#   mysql_medical_data:

networks:
  goservice:
