name: dataristix-pod

# Common settings for Dataristix services. The 'dataristix-secrect' volume should be configured with restricted access.
# ===========================================================================================================
x-dataristix-common: &dataristix-common
    volumes:
      - dataristix-data:/dataristix-data
      - dataristix-secret:/dataristix-secret

services:

# Dataristix Core Service. Module services specified with '--modules=' must follow below.
# =============================================================================
  dataristix-core:
    image: dataristix/dataristix-core:latest
    container_name: dataristix-core
    command: --modules="MQTT, PostgreSQL"
    <<: *dataristix-common

# Dataristix proxy and backend-for-frontend
# =================================
  dataristix-proxy:
    image: dataristix/dataristix-proxy:latest
    container_name: dataristix-proxy
    depends_on:
      - dataristix-core
    ports:
      - 8282:8282
    expose:
      - 8282
    <<: *dataristix-common


# Dataristix MQTT Connector 
# ===============================
  dataristix-for-mqtt:
    image: dataristix/dataristix-for-mqtt:latest
    container_name: dataristix-for-mqtt
    ports:
      # Expose broker ports. Adjust if different ports are configured. Add WebSocket ports if required.
      # Expose default TCP broker port
      - 1883:1883    
      # Expose TLS TCP broker port
      - 8883:8883
    <<: *dataristix-common

# Dataristix PostgreSQL Connector 
# ===============================
  dataristix-for-postgresql:
    image: dataristix/dataristix-for-postgresql:latest
    container_name: dataristix-for-postgresql
    <<: *dataristix-common

# PostgreSQL database, adjust to suit
# ===================================
  postgres:
    image: postgres:latest
    ports:
      - 5432:5432
    expose:
      - 5432
    user: postgres
    environment:
      -  POSTGRES_PASSWORD=mysecretpassword


# Grafana
# ===============================
  grafana:
    image: grafana/grafana-oss:latest
    ports:
      - 3000:3000

volumes:
    dataristix-data:
        name: dataristix-data
    dataristix-secret:
        name: dataristix-secret
