Skip to content

Commit

Permalink
Rate limiting to the compose prod
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottminns committed Nov 12, 2024
1 parent efe1dc0 commit d8ef610
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,23 @@ services:
image: ghcr.io/dreamsofcode-io/guestbook:prod
labels:
- "traefik.enable=true"
- "traefik.http.routers.guestbook.rule=Host(`zenful.cloud`)"
- "traefik.http.middlewares.guestbook-ratelimit.ratelimit.average=20"
- "traefik.http.routers.guestbook.rule=Host(`zenful.cloud`) && !Method(`POST`)"
- "traefik.http.routers.guestbook.entrypoints=websecure"
- "traefik.http.routers.guestbook.tls.certresolver=myresolver"
- "traefik.http.routers.guestbook.middlewares=guestbook-ratelimit"
# Define separate router for POST methods
- "traefik.http.middlewares.guestbook-ratelimit-post.ratelimit.average=1"
- "traefik.http.middlewares.guestbook-ratelimit-post.ratelimit.period=1m"
- "traefik.http.routers.guestbook-post.rule=Host(`zenful.cloud`) && Method(`POST`)"
- "traefik.http.routers.guestbook-post.middlewares=guestbook-ratelimit-post"
- "traefik.http.routers.guestbook-post.entrypoints=websecure"
- "traefik.http.routers.guestbook-post.tls.certresolver=myresolver"
# Proxy
- "traefik.http.routers.proxy.rule=Host(`proxy.dreamsofcode.io`)"
- "traefik.http.routers.proxy.entrypoints=websecure"
- "traefik.http.routers.proxy.tls.certresolver=myresolver"
# Enable watchtower
- "com.centurylinklabs.watchtower.enable=true"
environment:
- POSTGRES_HOST=db
Expand Down

0 comments on commit d8ef610

Please sign in to comment.