Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow Docker Secrets (eg; for db password) #2129

Open
Slevin90 opened this issue Jun 17, 2024 · 2 comments
Open

allow Docker Secrets (eg; for db password) #2129

Slevin90 opened this issue Jun 17, 2024 · 2 comments

Comments

@Slevin90
Copy link

Prerequisites

  • [ OK] I have searched open and closed issues to make sure that the bug has not yet been reported.

Bug report

the database password is visible in config > .env file
in the DB_URI -variable

Expected behavior
A safe method would be to use different variables (db_username, db_password, db_name) with support Docker Secrets
same for other secrets that can be used in the config

also makes a cleaner conmpose-file where the password can be re-used in the postgres and simplelogin config

@Slevin90
Copy link
Author

simple-login/simplelogin-postfix-docker#9

similar as the simplelogin-postfix-docker did already

@Blizzke
Copy link

Blizzke commented Jul 29, 2024

Even without secrets (which is swarm only and IMHO extremely unusable if you rotate secrets) and *_FILE support I would still never add passwords to the docker-compose file (which you usually want in you git repository. I just use env_file.

docker-compose.yml:

services:
  test:
    image: busybox:latest
    env_file:
      - .env

.env:

TEST_PASSWORD=password

docker compose config:

name: tmp
services:
  test:
    environment:
      TEST_PASSWORD: password
    image: busybox:latest
    networks:
      default: null
networks:
  default:
    name: tmp_default

The .env is just included in the folder where the stack sits but not included into your versioning system (they are usually part of the default .gitignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants