Reference
Env var references
A reference points a variable at a datastore or a service. Ferry puts the real value there at start.
You save a reference as the value of DATABASE_URL. Ferry keeps it as you wrote it.
1 / 5
The value of an environment variable can be a reference to a datastore or to a different service. You do not copy an address or a password.
Ferry saves the reference as you wrote it. When Ferry starts containers, it replaces the reference with the real value. Thus the value always agrees with its target.
Set a reference
ferry db create app-db --kind postgres
ferry env set api 'DATABASE_URL=${{datastore.app-db.connectionString}}'The container of api then gets DATABASE_URL=postgresql://app_db:<password>@app-db:5432/app_db.
Use single quotes
Always put a value with a reference between single quotes. If not, your shell tries to expand $.