Connecting Grafana datasource to remote serveur and postgres docker container

Hello!

I am currently working on setting up a Grafana configuration to monitor my application.
At the moment, i am working on a single server, so my Grafana docker container is running on the same server as my Postgres database container.
I am configuring my database as follow in grafana :
datasources:

  • name: Postgres
    type: postgres
    url: database-postgresql:5432

Its working fine.

We have some performance consideration about our main application and would like Grafana to run on a second server.

So it would mean

  • server 1
    Main APP docker container
    Postgres database docker container

-server 2
Grafana docker container

I would like to connect my grafana on server 2 to my Postgres database on server 1

The problem is I don’t know if there is a proper syntax to use in this configuration?
Like what would “url: database-postgresql:5432” become then ?

I hope my request (and english) is clear

Thank you,

Nicolas