FerryDocs
ConceptsDatastores

Connect a service

A reference gives the internal URL of a datastore to your service. Do not paste the URL.

Edit on GitHub
Private networkby nameDATABASE_URLa referenceServiceapiDatastoreapp-db:5432

You set a variable. Its value is a reference to the datastore.

1 / 3

Set the variable

Give the URL of the to your app in an .

Terminal
ferry env set api 'DATABASE_URL=${{datastore.app-db.connectionString}}'
ferry env set worker 'REDIS_URL=${{datastore.cache.connectionString}}'

connectionString is the . It works on the only.

Do not paste the URL

In a , use a . Then the service always gets the current value.

Other properties

A reference can also give one part of the URL.

PropertyValue
host, portThe internal host and port
user, password, databaseThe parts of the connection string
externalConnectionStringThe external URL

Environment explains the references. For a full example with migrations, see Deploy an app with Postgres.

On this page