services:

  rigctld:
    container_name: satnogs-<station ID>-rigctld
    image: 'librespace/hamlib:4.5.4'
    user: '999'
    read_only: true
    environment:
      MODEL: '1'
    restart: 'unless-stopped'
    command: 'rigctld'

  satnogs_client:
    container_name: satnogs-<station ID>
    hostname: 'satnogs-<station ID>'
    image: 'librespace/satnogs-client:2.1'
    # image: 'librespace/satnogs-client:master-unstable'

    user: '500:500'

    read_only: true
    device_cgroup_rules:
      - 'c 189:* rwm'
    environment:
      SATNOGS_API_TOKEN: '<user api key>'
      SATNOGS_LOG_LEVEL: 'INFO'
      SATNOGS_SOAPY_RX_DEVICE: 'driver=rtlsdr,biastee=false'
      SATNOGS_PPM_ERROR: '0'
      SATNOGS_RF_GAIN: '36.4'
      SATNOGS_ANTENNA: 'RX'
      SATNOGS_RX_SAMP_RATE: '2.048e6'
      SATNOGS_STATION_ELEV: '<station ID Altitude>'
      SATNOGS_STATION_ID: '<station ID>'
      SATNOGS_STATION_LAT: '<station ID Latitude>'
      SATNOGS_STATION_LON: '<station ID Longtitude>'
      SATNOGS_RIG_IP: 'rigctld'
      GR_SATELLITES_ENABLED: 'true'
      GR_SATELLITES_APP: 'gr_satellites'
      GR_SATELLITES_KEEPLOGS: 'true'
      # GR_SATELLITES_ZMQ_PORT: '5555'
      UDP_DUMP_HOST: '127.0.0.1'
      UDP_DUMP_PORT: '5<station ID>'
    command: 'satnogs-client'
    volumes:
      - type: 'tmpfs'
        target: '/tmp'
      - type: 'volume'
        target: '/var/lib/satnogs-client'
        source: 'satnogs-client'
      - type: 'volume'
        target: '/usr/lib/python3/dist-packages/satellites/satyaml'
        source: 'satyaml'
      - '/dev/bus/usb:/dev/bus/usb'
    restart: 'unless-stopped'

volumes:
  satnogs-client:
  satyaml:
