docker-apps/traefik/traefik_jm.txt
2025-04-03 22:57:52 +02:00

62 lines
2.0 KiB
Plaintext

https://docs.techdox.nz/traefik/
https://www.youtube.com/watch?v=wLrmmh1eI94
traefik user: 3012
traefik group: 3011
Create datasets
---------------
# In Truenas shell:
# list datasets
zfs list | grep -i "docker.*traefik"
# create following datasets if not present
zfs create SSD1/docker/data/traefik
zfs create SSD1/docker/data/traefik/appdata
zfs create SSD1/docker/data/traefik/logs
chown -R traefik:traefik /mnt/SSD1/docker/data/traefik
chmod 600 /mnt/SSD1/docker/data/traefik/appdata
Create folders
--------------
# In Truenas shell:
mkdir -p /mnt/SSD1/docker/stacks/traefik/secrets
mkdir /mnt/SSD1/docker/stacks/traefik/config
mkdir /mnt/SSD1/docker/stacks/traefik/rules
mkdir /mnt/SSD1/docker/stacks/traefik/users
Copy folder to docker stacks
----------------------------
# In Windows cmd shell in traefik folder, enter:
./cp2nas
# or
pscp -P 22 -r stacks/*.* root@192.168.2.2:/mnt/SSD1/docker/stacks/traefik/
# This should copy traefik stacks folder to /mnt/SSD1/docker/stacks/traefik
Creating secrets
----------------
# In Truenas shell:
cd /mnt/SSD1/docker/stacks/traefik/secrets
echo -n 'your_cf_dns_api_token' > /mnt/SSD1/docker/stacks/traefik/secrets/cf_dns_api_token
chown -R traefik:traefik /mnt/SSD1/docker/stacks/traefik
chmod -R 400 /mnt/SSD1/docker/stacks/traefik
# Skip the next section if you do not need to use basic-auth middlewares
Creating user password hash strings for user authorisation with basic-auth middlewares
--------------------------------------------------------------------------------------
# follow steps in "creating user password hash strings for user authorisation with traefik basic-auth middlewares.txt"
Start traefik
-------------
# In docker shell:
docker compose -f /opt/stacks/traefik/compose.yml up -d
Certificates
------------
# The SSL certificates will be stored in /mnt/SSD1/docker/data/traefik/appdata folder in acme.json file
# Keep this folder clean
# If you want to save any certificates in this folder separately, make sure that you manage it, e.g. delete all certificates manually added to this folder when they expire