You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced-config/README.md
+50-2Lines changed: 50 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,53 @@
1
1
# Advanced Configuration
2
2
3
+
## Best Practice: Use a docker network
4
+
5
+
For those who have a few of their upstream services running in docker on the same docker
6
+
host as NPM, here's a trick to secure things a bit better. By creating a custom docker network,
7
+
you don't need to publish ports for your upstream services to all of the docker host's interfaces.
8
+
9
+
Create a network, ie "scoobydoo":
10
+
11
+
```bash
12
+
docker network create scoobydoo
13
+
```
14
+
15
+
Then add the following to the `docker-compose.yml` file for both NPM and any other
16
+
services running on this docker host:
17
+
18
+
```yml
19
+
networks:
20
+
default:
21
+
external:
22
+
name: scoobydoo
23
+
```
24
+
25
+
Let's look at a Portainer example:
26
+
27
+
```yml
28
+
version: '3'
29
+
services:
30
+
31
+
portainer:
32
+
image: portainer/portainer
33
+
privileged: true
34
+
volumes:
35
+
- './data:/data'
36
+
- '/var/run/docker.sock:/var/run/docker.sock'
37
+
restart: always
38
+
39
+
networks:
40
+
default:
41
+
external:
42
+
name: scoobydoo
43
+
```
44
+
45
+
Now in the NPM UI you can create a proxy host with `portainer` as the hostname,
46
+
and port `9000` as the port. Even though this port isn't listed in the docker-compose
47
+
file, it's "exposed" by the portainer docker image for you and not available on
48
+
the docker host outside of this docker network. The service name is used as the
49
+
hostname, so make sure your service names are unique when using the same network.
50
+
3
51
## Docker Secrets
4
52
5
53
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.
0 commit comments