Be Your Own Cloud code · PART 2 — FOUNDATION
Chapter 9 Secrets and Environment Files: Doing This Safely From Day One
The .env Pattern
# p. 42
# .env
ADMIN_TOKEN=changeme_to_a_long_random_string
DB_PASSWORD=changeme_to_a_long_random_string # p. 42
How a compose file reads a value from .env.
# docker-compose.yml references it like this:
environment:
- ADMIN_TOKEN=${ADMIN_TOKEN} Locking the File Down
# p. 42
chmod 600 .env
echo '.env' >> .gitignore The Bootstrap Problem
# p. 43
# generates a strong random value for any secret you need now
openssl rand -base64 48 Reproduced exactly from Be Your Own Cloud, Chapter 9. The book explains what each line does and what to do when it doesn't work. About the book
Something here not working as the book describes? Tell the author.