-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8f5a40
commit bf8c868
Showing
5 changed files
with
112 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Full example of using Traefik Guardian | ||
|
||
This is an example `docker-compose.yml` that uses Traefik Guardian to protect a service (`whoami`) that is behind the Traefik reverse proxy. | ||
|
||
```yaml | ||
version: '3' | ||
|
||
services: | ||
traefik: # Your traefik service | ||
image: "traefik:latest" | ||
container_name: "traefik" | ||
networks: | ||
- proxy | ||
command: | ||
- "--providers.docker=true" | ||
- "--providers.docker.exposedbydefault=false" | ||
- "--entrypoints.web.address=:80" | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock:ro" | ||
|
||
traefik-guardian: # Your traefik-guardian service | ||
image: marvinjwendt/traefik-guardian:latest | ||
environment: | ||
- AUTH_HOST=auth.test.localhost # Replace with your auth host (e.g.: auth.example.com). | ||
- PASSWORDS=plaintext:test1234|test1337 # Replace with your passwords. See the docs for more info at: https://github.com/MarvinJWendt/traefik-guardian#password-management | ||
networks: | ||
- proxy | ||
labels: | ||
- traefik.enable=true | ||
- traefik.docker.network=proxy | ||
- traefik.http.routers.auth.entrypoints=web | ||
- traefik.http.routers.auth.rule=Host(`auth.test.localhost`) || Path(`/traefik-guardian-session-share`) # Replace auth.test.localhost with your auth host defined above. | ||
- traefik.http.middlewares.traefik-guardian.forwardauth.address=http://traefik-guardian/auth | ||
|
||
whoami: # A demo whoami service that is protected with traefik-guaridan | ||
image: containous/whoami | ||
container_name: "whoami" | ||
networks: | ||
- proxy | ||
labels: | ||
- traefik.enable=true | ||
- traefik.docker.network=proxy | ||
- traefik.http.routers.whoami.entrypoints=web | ||
- traefik.http.routers.whoami.rule=Host(`whoami.test.localhost`) | ||
- traefik.http.routers.whoami.middlewares=traefik-guardian # Add this to services that you want to guard | ||
|
||
networks: | ||
proxy: | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
version: '3' | ||
|
||
services: | ||
traefik: # Your traefik service | ||
image: "traefik:latest" | ||
container_name: "traefik" | ||
networks: | ||
- proxy | ||
command: | ||
- "--providers.docker=true" | ||
- "--providers.docker.exposedbydefault=false" | ||
- "--entrypoints.web.address=:80" | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock:ro" | ||
|
||
traefik-guardian: # Your traefik-guardian service | ||
image: marvinjwendt/traefik-guardian:latest | ||
environment: | ||
- AUTH_HOST=auth.test.localhost # Replace with your auth host (e.g.: auth.example.com). | ||
- PASSWORDS=plaintext:test1234|test1337 # Replace with your passwords. See the docs for more info at: https://github.com/MarvinJWendt/traefik-guardian#password-management | ||
networks: | ||
- proxy | ||
labels: | ||
- traefik.enable=true | ||
- traefik.docker.network=proxy | ||
- traefik.http.routers.auth.entrypoints=web | ||
- traefik.http.routers.auth.rule=Host(`auth.test.localhost`) || Path(`/traefik-guardian-session-share`) # Replace auth.test.localhost with your auth host defined above. | ||
- traefik.http.middlewares.traefik-guardian.forwardauth.address=http://traefik-guardian/auth | ||
|
||
whoami: # A demo whoami service that is protected with traefik-guaridan | ||
image: containous/whoami | ||
container_name: "whoami" | ||
networks: | ||
- proxy | ||
labels: | ||
- traefik.enable=true | ||
- traefik.docker.network=proxy | ||
- traefik.http.routers.whoami.entrypoints=web | ||
- traefik.http.routers.whoami.rule=Host(`whoami.test.localhost`) | ||
- traefik.http.routers.whoami.middlewares=traefik-guardian # Add this to services that you want to guard | ||
|
||
networks: | ||
proxy: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters