Using traefik and Caddy
Idea stolen from https://blog.kmonsoor.com/deploying-golink-server-using-Caddy/
Using traefik and Caddy
Idea stolen from https://blog.kmonsoor.com/deploying-golink-server-using-Caddy/
| :80 { | |
| map {path} {redirect-uri} { | |
| /example https://www.google.de | |
| # more | |
| # ... | |
| } | |
| # this below code is required to actually make the above `map` work | |
| @hasRedir expression `{redirect-uri} != ""` | |
| redir @hasRedir {redirect-uri} | |
| # code below is to set the default response if the requested shortlink isn't here | |
| respond "Thas's an unknown short URL ... :(" | |
| } |
| services: | |
| caddy: | |
| image: caddy:2.8.4-alpine | |
| container_name: shorty | |
| networks: | |
| - traefik-proxy | |
| restart: unless-stopped | |
| volumes: | |
| - ./Caddyfile:/etc/caddy/Caddyfile | |
| - data:/data | |
| - config:/config | |
| labels: | |
| - 'traefik.enable=true' | |
| - '[...]' | |
| volumes: | |
| data: | |
| config: | |
| networks: | |
| traefik-proxy: | |
| external: true |