mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-10-28 12:45:47 +00:00
Any router name works as long as it is consistently applied. The `nginx` name for the `whoami` container route can be a bit confusing for new users. Aligning the container and route name is similar to how Traefik generates dynamic routes, makes it easier to read the compose file and logs, and can generally help reduce bugs when extending the example.
30 lines
945 B
YAML
30 lines
945 B
YAML
services:
|
|
traefik:
|
|
container_name: traefik
|
|
image: traefik:v3.3
|
|
command: --api.insecure=true --providers.docker
|
|
ports:
|
|
- 80:80
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
whoami:
|
|
container_name: whoami
|
|
image: traefik/whoami:latest
|
|
labels:
|
|
traefik.enable: true
|
|
traefik.http.routers.whoami.rule: Host(`whoami.example.com`)
|
|
traefik.http.routers.whoami.middlewares: tinyauth
|
|
|
|
tinyauth:
|
|
container_name: tinyauth
|
|
image: ghcr.io/steveiliop56/tinyauth:v3
|
|
environment:
|
|
- SECRET=some-random-32-chars-string
|
|
- APP_URL=https://tinyauth.example.com
|
|
- USERS=user:$$2a$$10$$UdLYoJ5lgPsC0RKqYH/jMua7zIn0g9kPqWmhYayJYLaZQ/FTmH2/u # user:password
|
|
labels:
|
|
traefik.enable: true
|
|
traefik.http.routers.tinyauth.rule: Host(`tinyauth.example.com`)
|
|
traefik.http.middlewares.tinyauth.forwardauth.address: http://tinyauth:3000/api/auth/traefik
|