Skip to content

Commit b78b681

Browse files
committed
add note for migrating to dotenvx
1 parent ab0c1d4 commit b78b681

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,24 @@ Your `.env.vault` is decrypted on boot, its environment variables injected, and
976976

977977
Congratulations, your secrets are now much safer than scattered across multiple servers and cloud providers!
978978

979+
### Migrating to Dotenvx
980+
981+
With dotenvx you put your development, staging, ci, and production secrets IN your code - as encrypted `.env.*` files. So for example, to do production you would
982+
983+
1. Create `.env.production` with `HELLO=production`
984+
2. Run `dotenvx encrypt -f .env.production` to encrypt it
985+
3. Commit that to code
986+
987+
Then when deploying your codebase you put `dotenvx run --` out front of your run command.
988+
989+
1. Add `dotenvx run -- yourstartcommand`
990+
2. Set `DOTENV_PRIVATE_KEY_PRODUCTION` on the server
991+
3. On boot `dotenvx run` will read the private key and use it to decrypt and inject your secrets just in time as environment variables
992+
993+
Here's a [quickstart guide](https://dotenvx.com/docs/quickstart#add-encryption)
994+
995+
For migrationg to dotenv-vault simply switch step 1 with `npx dotenv-vault@latest pull production`.
996+
979997
## Contributing
980998

981999
See [CONTRIBUTING.md](CONTRIBUTING.md)

0 commit comments

Comments
 (0)