DEV Community

Discussion on: Configure Symfony Secrets with Hashicorp Vault

gromnan profile image
Jérôme TAMARELLE Author • Edited on

After your remark, I found that vault-agent have an option to run a command to run composer dump-env prod when .env is actually modified.

command (string: "") - This is the optional command to run when the template is rendered. The command will only run if the resulting template changes. The command must return within 30s (configurable), and it must have a successful exit code. Vault Agent is not a replacement for a process monitor or init system.

template {
  source = "./.env.local.ctmpl"
  destination = "./.env.local"
  command = "composer dump-env prod"
Enter fullscreen mode Exit fullscreen mode