Loki data source connection on docker compose

Hi Team,

On grafana, I’m creating my required data source on the fly through docker-compose and datasource.yml. I can able do it for influxdb but for Loki, it getting failed. Can someone guide me on this?

apiVersion: 1
datasources:

  • name: InfluxDB_OnTheFly
    type: influxdb
    access: proxy
    database: mydb
    user: myusername
    password: mypassword
    url: http://influxdblocal:8086/
    isDefault: true
    editable: true

datasources1: