[Question] How to use Docker Secrets in Docker Swarm to set WAHA_DASHBOARD_PASSWORD without exposing it in environment variables?
Hello!
I’m using Docker Swarm and I’d like to know how I can use secrets to store passwords without exposing them in environment variables.
I couldn’t find anything in the documentation mentioning an alternative to the environment variable WAHA_DASHBOARD_PASSWORD — something like WAHA_DASHBOARD_PASSWORD_FILE.
I’ve already tried running the command manually in my docker-compose.yml, for example:
command: ["node", "/app/dist/index.js"]
or
command: ["/app/start-wrapper.sh", "node", "dist/src/main.js"]
but in both cases I get the following errors:
Error: Cannot find module '/app/dist/index.js'
or
Error: Cannot find module '/app/dist/src/main.js'
Question:
What is the correct way to use Docker secrets in this case? Is there a way to replace WAHA_DASHBOARD_PASSWORD with a variable that reads the content from a file (like WAHA_DASHBOARD_PASSWORD_FILE or equivalent)?
If not, what is the recommended way to inject the password securely into the Docker Swarm container?
English
Hello!
I'm using Docker Swarm and I would like to know how I can use secrets to store passwords without having to make them visible in environment variables.
In the documentation, I didn't find anything about an alternative to the WAHA_DASHBOARD_PASSWORD environment variable using something like WAHA_DASHBOARD_PASSWORD_FILE.
I've already tried passing the command manually in docker-compose.yml, for example:
command: ["node", "/app/dist/index.js"]
or
command: ["/app/start-wrapper.sh", "node", "dist/src/main.js"]
but in both cases I get the error:
Error: Cannot find module '/app/dist/index.js'
or
Error: Cannot find module '/app/dist/src/main.js'
Question:
What is the correct way to use Docker secrets in this case — is there any way to replace WAHA_DASHBOARD_PASSWORD with a variable that reads the contents of a file (WAHA_DASHBOARD_PASSWORD_FILE or equivalent)?
And if not, what would be the recommended way to securely inject the password into the Docker Swarm container?
Portuguese
Title:
variáveis env são bastante seguras