Docker security - support secrets
Author: alaricljsCreated Jun 9, 2023Updated Sep 18, 2026
It would be helpful for the docker image and compose example to properly support Docker secrets. Generally this is achieved by adding an env var NNNN_FILE where NNNN is any env var that should contain sensitive info. The NNNN_FILE will then be pointed to a mounted secret containing the sensitive data and the docker container/software will need to read that file rather than the NNNN env var.
See postgres' own docker container and POSTGRES_PASSWORD_FILE as an example of implementation.
Source: semaphoreui/semaphore