fix(dev): pass Stripe test-mode keys to the api container (BUNYIP-175) #207
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-175-compose-pass-stripe-keys"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Follow-up to #206. The dev api container gets its env only from compose.dev.yml's explicit
environment:block (there is noenv_file:). That block forwardedSTRIPE_ENCRYPTION_KEYbut notSTRIPE_SECRET_KEY/STRIPE_WEBHOOK_SECRET, so setting those two in.env(as the new docs and.env.exampleinstruct) had no effect - the api never saw them and payment stayed disabled.Fix
Add both vars to the api
environment:block using the same${VAR:-}pattern as the rest of the file. Empty default keeps payment disabled; a populated.envnow reaches the api. Verified withdocker compose -f compose.dev.yml config(both resolve into the api service).Apply locally
docker compose -f compose.dev.yml up -d apito recreate the container (a plainrestartreuses the old container env and will not pick up the change).🤖 Generated with Claude Code
The dev api container receives env only through compose.dev.yml's explicit `environment:` block (there is no `env_file:`), and that block forwarded `STRIPE_ENCRYPTION_KEY` but not the test-mode `STRIPE_SECRET_KEY` / `STRIPE_WEBHOOK_SECRET`. As a result, setting those two in `.env` (as dev-docs/stripe-test-mode.md and .env.example now instruct) had no effect: the api process never saw them and payment stayed disabled. Add both vars to the api `environment:` block with the `${VAR:-}` pattern used by the rest of the file, so an empty default keeps payment disabled and a populated `.env` reaches the api. `docker compose -f compose.dev.yml config` now resolves both into the api service. Recreate the api container to pick up the values: `docker compose -f compose.dev.yml up -d api` (a plain `restart` reuses the old container env). #BUNYIP-175 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>