From 625a899f640c132078f2d3a656404455bb05163a Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Sun, 23 Jul 2023 18:53:52 -0400 Subject: [PATCH] Update environment-variables.md (#3402) Add documentation for the environment variables that enable Docker secrets support Support for these variables was implemented in #1254 and #3282 --- docs/docs/install/environment-variables.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/docs/install/environment-variables.md b/docs/docs/install/environment-variables.md index e775735734..09a4305167 100644 --- a/docs/docs/install/environment-variables.md +++ b/docs/docs/install/environment-variables.md @@ -184,3 +184,24 @@ Typesense URL example JSON before encoding: | `MACHINE_LEARNING_CLASSIFICATION_MODEL` | Classification Model | `microsoft/resnet-50` | machine learning | | `MACHINE_LEARNING_CACHE_FOLDER` | ML Cache Location | `/cache` | machine learning | | `TRANSFORMERS_CACHE` | ML Transformers Cache Location | `/cache` | machine learning | + +## Docker Secrets + +The following variables support the use of [Docker secrets](https://docs.docker.com/engine/swarm/secrets/) for additional security. + +To use any of these, replace the regular environment variable with the equivalent `_FILE` environment variable. The value of +the `_FILE` variable should be set to the path of a file containing the variable value. + +| Regular Variable | Equivalent Docker Secrets '\_FILE' Variable | +| :----------------: | :-----------------------------------------: | +| `DB_HOSTNAME` | `DB_HOSTNAME_FILE`\*1 | +| `DB_DATABASE_NAME` | `DB_DATABASE_NAME_FILE`\*1 | +| `DB_USERNAME` | `DB_USERNAME_FILE`\*1 | +| `DB_PASSWORD` | `DB_PASSWORD_FILE`\*1 | +| `REDIS_PASSWORD` | `REDIS_PASSWORD_FILE`\*2 | + +\*1: See the [official documentation](https://github.com/docker-library/docs/tree/master/postgres#docker-secrets) for +details on how to use Docker Secrets in the Postgres image. + +\*2: See [this comment](https://github.com/docker-library/redis/issues/46#issuecomment-335326234) for an example of how +to use use a Docker secret for the password in the Redis container.