Skip to content

Commit

Permalink
feat: add docker compose configuration for test
Browse files Browse the repository at this point in the history
  • Loading branch information
ISNing committed May 23, 2024
1 parent 20ff3f2 commit 09e50e7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.9'

services:
traefik:
image: traefik:v3.0
command:
- --api.insecure=true
- --providers.docker
- --providers.file.filename=/rules-rewrite-body.yaml
- --log.level=DEBUG
- --experimental.localPlugins.rewrite-body.moduleName=github.com/the-ccsn/traefik-plugin-rewritebody
ports:
- 80:80
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./rules-rewrite-body.yaml:/rules-rewrite-body.yaml
- .:/plugins-local/src/github.com/the-ccsn/traefik-plugin-rewritebody/
tty: true

whoami:
image: traefik/whoami # https://github.com/traefik/whoami
command: -name whoami
labels:
traefik.http.routers.whoami.rule: Host(`whoami.localhost`)
traefik.http.routers.whoami.middlewares: rewrite-body@file
20 changes: 20 additions & 0 deletions rules-rewrite-body.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Template for configuration

http:
middlewares:
rewrite-body:
plugin:
rewrite-body:
lastModified: true
rewrites:
- regex: "bar"
replacement: "foo"
monitoring:
types:
- text/html
methods:
- GET
checkMimeAccept: true
checkMimeContentType: true
checkAcceptEncoding: true
checkContentEncoding: true

0 comments on commit 09e50e7

Please sign in to comment.