Skip to content

Commit f010932

Browse files
committed
Add Symfony runtime injection documentation
Document how Symfony applications only need secrets injected during cache:warmup, after which all commands use the compiled container from var/cache/prod/
1 parent 6c4895c commit f010932

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ composer require stechstudio/keep
3939
# Create template from existing secrets
4040
./vendor/bin/keep template:add .env.template --stage=production
4141

42-
# Use template with placeholders
43-
./vendor/bin/keep export --stage=production --template=.env.template --file=.env
42+
# Use template with placeholders to generate .env file
43+
./vendor/bin/keep export --stage=production --template=env/production.env --file=.env
4444

45-
# Runtime injection - execute with secrets, no files created
45+
# Runtime injection - execute with secrets, no .env file created
4646
./vendor/bin/keep run --vault=ssm --stage=production -- npm start
4747
```
4848

docs/guide/deployment/runtime-injection.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ php artisan queue:restart
3939

4040
Once cached, Laravel completely ignores environment variables, reading everything from `bootstrap/cache/config.php`.
4141

42+
## Symfony Applications
43+
44+
Symfony compiles environment variables into the container during cache warmup. After compilation, all commands use the cached container:
45+
46+
```bash
47+
# Inject secrets during container compilation (only injection needed!)
48+
keep run --vault=ssm --stage=production -- php bin/console cache:warmup --env=prod
49+
50+
# All subsequent commands use compiled container - no injection required
51+
php bin/console doctrine:migrations:migrate --no-interaction
52+
php bin/console messenger:consume async
53+
```
54+
55+
Once compiled, Symfony reads configuration from `var/cache/prod/` and never accesses environment variables.
56+
4257
## Node.js Applications
4358

4459
```bash

0 commit comments

Comments
 (0)