Update Servers/Containerization/Docker/Compose/Traefik.md

This commit is contained in:
2025-04-21 00:00:14 -06:00
parent 203e6f2457
commit cb6f270b42

View File

@ -29,7 +29,7 @@
- Lastly, you need to ensure that port 80 on your firewall is opened to the IP of the Traefik Reverse Proxy to allow Let's Encrypt to do TLS-based challenges.
### Stack Deployment Information
```jsx title="docker-compose.yml"
```yaml title="docker-compose.yml"
version: "3.3"
services:
traefik:
@ -103,7 +103,7 @@ networks:
```
```jsx title=".env"
```yaml title=".env"
CF_API_EMAIL=nicole.rappe@bunny-lab.io
CF_API_KEY=REDACTED-CLOUDFLARE-DOMAIN-API-KEY
LETSENCRYPT_EMAIL=nicole.rappe@bunny-lab.io
@ -118,7 +118,7 @@ Traefik operates in two ways, the first is labels, while the second are dynamic
### Docker-Compose Labels
The first is that it reads "labels" from the docker-compose file of any deployed containers on the same host as Traefik. These labels typically look something like the following:
```jsx title="docker-compose.yml"
```yaml title="docker-compose.yml"
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitea.rule=Host(`example.bunny-lab.io`)"
@ -134,7 +134,7 @@ Dynamic configuration files exist under the Traefik container located at `/etc/t
An example of a dynamic configuration file would look something like this:
```jsx title="/etc/traefik/dynamic/example.bunny-lab.io.yml"
```yaml title="/etc/traefik/dynamic/example.bunny-lab.io.yml"
http:
routers:
example:
@ -161,7 +161,7 @@ You can see the similarities between the labeling method and how you designate t
For example, `remote.bunny-lab.io` would be written as `remote-bunny-lab-io`. This keeps things organized and easy to read if you are troubleshooting things in Traefik's logs or webUI. The complete configuration file would look like the example below:
```jsx title="/etc/traefik/dynamic/remote.bunny-lab.io.yml"
```yaml title="/etc/traefik/dynamic/remote.bunny-lab.io.yml"
http:
routers:
remote-bunny-lab-io: