I want to dockerize my spring cloud config server application. I am creating a docker secret git-repo-pass
to store the github account password. I am setting the environment SPRING_CLOUD_CONFIG_SERVER_GIT_PASSWORD
with the default path for docker secrets that is /run/secrets/git-repo-pass
. But, when I run the compose and inspect the container, I see that the environment is literally set to the path and not the contents of that path.
Sharing my docker-compose.yml file below,
version: '3.8'
services:
config-standalone:
container_name: config-standalone
image: ss-config:1.0
ports:
- "8888:8888"
secrets:
- git-repo-pass
environment:
- SPRING-CLOUD-CONFIG-SERVER-GIT-PASSWORD=/run/secrets/git-repo-pass
secrets:
git-repo-pass:
external: true
Exception thrown:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.IllegalStateException: Cannot load environment] with root cause
Please let me know if there is a way to load the application properties using docker secrets. Thank You !!