I want to access a secret file with docker-compose. I follow many tutorials and reproduce the structure. The container is launched but when I need to log in, the right string to enter is "/run/secrets/sec_pgadmin_default_email". I want the login to be the one inside my secret file: admin. In this secret file pgadmin_default_email.txt, there is only the word admin. I don't know if the structure of this file is good. Should it be a dictionary or something else ?
version: '3.8' services: pgadmin4:
build:
context: ./dockerfiles/
dockerfile: dockerfile_pgadmin4
image: img_pgadmin
container_name: cont_pgadmin4
ports:
- "80:80"
secrets:
- sec_pgadmin_default_email
- sec_pgadmin_default_password
environment:
- PGADMIN_LISTEN_PORT=80
- PGADMIN_DEFAULT_EMAIL=/run/secrets/sec_pgadmin_default_email
- PGADMIN_DEFAULT_PASSWORD=/run/secrets/sec_pgadmin_default_password
secrets:
sec_pgadmin_default_email:
file: ./.secrets/pgadmin_default_email.txt
sec_pgadmin_default_password:
file: ./.secrets/pgadmin_default_password.txt
PS I just use the command docker-compose up -d, without swarn things or else. I don't define external secrets and I prefer not. Is it possible ?