Use secrets and configs

This commit is contained in:
Colin Hebert
2022-12-26 09:31:35 +01:00
parent 5ed0d74242
commit 17dee3af90
7 changed files with 22 additions and 8 deletions

View File

@@ -21,8 +21,9 @@ services:
networks:
- traefik
- docker
volumes:
- traefik:/etc/traefik/
configs:
- source: traefik
target: /etc/traefik/
depends_on:
- docker
restart: unless-stopped
@@ -40,6 +41,8 @@ services:
- traefik
volumes:
- portainer:/data
secrets:
- portainer_password
depends_on:
- docker
restart: unless-stopped
@@ -67,8 +70,12 @@ volumes:
portainer:
driver_opts:
<<: *bind-volume
device: ${MOUNT_DIR?}/portainer/
device: ${MOUNT_DIR?}/portainer/data/
config:
traefik:
driver_opts:
<<: *bind-volume
device: ${MOUNT_DIR?}/traefik/
file: ${MOUNT_DIR?}/traefik/config/
secrets:
portainer_password:
file: ${MOUNT_DIR?}/portainer/secrets/portainer_password

4
mounts/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
*/data/*
!*/data/README.md
*/secrets/*
!*/secrets/README.md

View File

View File

@@ -0,0 +1,2 @@
Contains the file `portainer_password`
More on https://docs.portainer.io/advanced/cli#method-2-creating-the-account-using-a-file

View File

@@ -3,3 +3,6 @@ providers:
endpoint: tcp://docker:2375
exposedByDefault: false
network: traefik
api:
insecure: true

View File

@@ -1 +0,0 @@
./portainer_password

View File

@@ -1 +0,0 @@
admin