Environment variables and secrets
Set secrets (API keys, passwords) as project environment variables: the project’s Settings tab in the dashboard, or PUT /projects/{id}/env-vars/{KEY} with {"value": "..."}. They’re stored encrypted, and their values are never shown again after saving.
How they reach your services
Section titled “How they reach your services”A project variable is given to every service of the project, unless the compose file already sets that key to a value:
services: web: image: ghcr.io/acme/shop:1.4.2 environment: LOG_LEVEL: info # your value wins STRIPE_KEY: # blank: filled in from the project's STRIPE_KEY # DATABASE_URL not listed: still filled in from the project's DATABASE_URL- A value written in the file always wins.
- A key listed with no value (
STRIPE_KEY:or- STRIPE_KEY) is the clearest way to say “this comes from the project”. - Changing a variable takes effect on the next deploy.
The deployment’s Compose tab shows these keys blank: the real values never appear there.
env_file
Section titled “env_file”Not supported: only the compose file itself is sent, not other files next to it. Use project variables instead.