Setting up Datasource on start up

Hi I need to set up a PostgreSQL datasource. I am using the latest docker image. I have tried following the directions in link, but I am not sure if I am putting the files in the correct places or if I am doing something else wrong. I have been going through the logs from the docker image and I dont seem to find that grafana was trying to do any sort of connection to the PostgreSQL server. Any help would be greatly appreciated.
Thanks

Here is my YAML file in case it helps:

apiVersion: 1
datasources:
- name: YOLOv5
  type: PostgreSQL
  access: proxy
  orgId: 1
  uid: my_unique_uid
  url: http://localhost:5432
  user: user 
  database: test
  basicAuth:
  basicAuthUser: user
  withCredentials:
  isDefault:
  jsonData:
    postgresVersion: '15.1'
    tlsAuth: false
    tlsAuthWithCACert: false
  secureJsonData:
    password: password
    basicAuthPassword: password
  version: 1
  editable: false