Skip to content

Commit 3964bbf

Browse files
committed
update advanced-config/readme with secrets
1 parent 11175aa commit 3964bbf

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

docs/advanced-config/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
11
# Advanced Configuration
22

3+
## Docker Secrets
4+
5+
This image supports the use of Docker secrets to import from file and keep sensitive usernames or passwords from being passed or preserved in plaintext.
6+
7+
You can set any environment variable from a file by appending `__FILE` (double-underscore FILE) to the environmental variable name.
8+
9+
```yml
10+
version: "3.7"
11+
12+
secrets:
13+
# Secrets are single-line text files where the sole content is the secret
14+
# Paths in this example assume that secrets are kept in local folder called ".secrets"
15+
DB_ROOT_PWD:
16+
file: .secrets/db_root_pwd.txt
17+
MYSQL_PWD:
18+
file: .secrets/mysql_pwd.txt
19+
20+
services:
21+
app:
22+
image: 'jc21/nginx-proxy-manager:latest'
23+
restart: always
24+
ports:
25+
# Public HTTP Port:
26+
- '80:80'
27+
# Public HTTPS Port:
28+
- '443:443'
29+
# Admin Web Port:
30+
- '81:81'
31+
environment:
32+
# These are the settings to access your db
33+
DB_MYSQL_HOST: "db"
34+
DB_MYSQL_PORT: 3306
35+
DB_MYSQL_USER: "npm"
36+
# DB_MYSQL_PASSWORD: "npm" # use secret instead
37+
DB_MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
38+
DB_MYSQL_NAME: "npm"
39+
# If you would rather use Sqlite uncomment this
40+
# and remove all DB_MYSQL_* lines above
41+
# DB_SQLITE_FILE: "/data/database.sqlite"
42+
# Uncomment this if IPv6 is not enabled on your host
43+
# DISABLE_IPV6: 'true'
44+
volumes:
45+
- ./data:/data
46+
- ./letsencrypt:/etc/letsencrypt
47+
depends_on:
48+
- db
49+
db:
50+
image: jc21/mariadb-aria
51+
restart: always
52+
environment:
53+
# MYSQL_ROOT_PASSWORD: "npm" # use secret instead
54+
MYSQL_ROOT_PASSWORD__FILE: /run/secrets/DB_ROOT_PWD
55+
MYSQL_DATABASE: "npm"
56+
MYSQL_USER: "npm"
57+
# MYSQL_PASSWORD: "npm" # use secret instead
58+
MYSQL_PASSWORD__FILE: /run/secrets/MYSQL_PWD
59+
volumes:
60+
- ./data/mysql:/var/lib/mysql
61+
```
62+
63+
364
## Disabling IPv6
465
566
On some docker hosts IPv6 may not be enabled. In these cases, the following message may be seen in the log:

0 commit comments

Comments
 (0)