diff options
author | Boris Gorbylev <ekho@ekho.name> | 2020-03-31 17:23:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 14:23:57 +0000 |
commit | efe3caebdcd0cf23553aedd8d0f56cea4a5053fa (patch) | |
tree | 99b1bdc09982bbd736942f9c7dd529e4371e1a6e /README.md | |
parent | cf3476d71b65222f9a1959c4a30589957c0a1fd7 (diff) |
Compatibility with docker secrets (#560)
* Read passwords from files specified with *_PASSWORD_FILE variables (docker secrets)
Fixes #731
Signed-off-by: Boris Gorbylev <ekho@ekho.name>
Signed-off-by: Jonas Thelemann <e-mail@jonas-thelemann.de>
* Add NEXTCLOUD_ADMIN_USER, POSTGRES_DB, POSTGRES_USER
Signed-off-by: Jonas Thelemann <e-mail@jonas-thelemann.de>
* Fix Variables
Signed-off-by: Jonas Thelemann <e-mail@jonas-thelemann.de>
Co-authored-by: Jonas Thelemann <e-mail@jonas-thelemann.de>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 62 |
1 files changed, 62 insertions, 0 deletions
@@ -252,6 +252,68 @@ services: Then run `docker-compose up -d`, now you can access Nextcloud at http://localhost:8080/ from your host system. +# Docker Secrets +As an alternative to passing sensitive information via environment variables, _FILE may be appended to the previously listed environment variables, causing the initialization script to load the values for those variables from files present in the container. In particular, this can be used to load passwords from Docker secrets stored in /run/secrets/<secret_name> files. For example: +```yaml +version: '3.2' + +services: + db: + image: postgres + restart: always + volumes: + - db:/var/lib/postgresql/data + environment: + - POSTGRES_DB_FILE=/run/secrets/postgres_db + - POSTGRES_USER_FILE=/run/secrets/postgres_user + - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password + secrets: + - postgres_db + - postgres_password + - postgres_user + + app: + image: nextcloud + restart: always + ports: + - 8080:80 + volumes: + - nextcloud:/var/www/html + environment: + - POSTGRES_HOST=db + - POSTGRES_DB_FILE=/run/secrets/postgres_db + - POSTGRES_USER_FILE=/run/secrets/postgres_user + - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password + - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/nextcloud_admin_password + - NEXTCLOUD_ADMIN_USER_FILE=/run/secrets/nextcloud_admin_user + depends_on: + - db + secrets: + - nextcloud_admin_password + - nextcloud_admin_user + - postgres_db + - postgres_password + - postgres_user + +volumes: + db: + nextcloud: + +secrets: + nextcloud_admin_password: + file: ./nextcloud_admin_password.txt # put admin password to this file + nextcloud_admin_user: + file: ./nextcloud_admin_user.txt # put admin username to this file + postgres_db: + file: ./postgres_db.txt # put postgresql db name to this file + postgres_password: + file: ./postgres_password.txt # put postgresql password to this file + postgres_user: + file: ./postgres_user.txt # put postgresql username to this file +``` + +Currently, this is only supported for `NEXTCLOUD_ADMIN_PASSWORD`, `NEXTCLOUD_ADMIN_USER`, `MYSQL_DB`, `MYSQL_PASSWORD`, `MYSQL_USER`, `POSTGRES_DB`, `POSTGRES_PASSWORD`, `POSTGRES_USER`. + # Make your Nextcloud available from the internet Until here, your Nextcloud is just available from you docker host. If you want your Nextcloud available from the internet adding SSL encryption is mandatory. |