Skip to content

Commit

Permalink
Task 14 : Revise application.yaml and docker-compose.yml for Redis
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapter1990 committed Jun 29, 2024
1 parent 73cc314 commit 2846f59
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ services:
networks:
- ratelimiterNetwork

redis:
container_name: redis
image: redis:latest
restart: always
ports:
- "6379:6379"
networks:
- ratelimiterNetwork

ratelimiterexample:
image: 'ratelimiter:latest'
build:
Expand All @@ -39,8 +48,11 @@ services:
- SECURITY_DB_IP=database
- SECURITY_DB_PORT=3307
- spring.datasource.url=jdbc:mysql://host.docker.internal:3307/ratelimiter
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- database
- redis
networks:
- ratelimiterNetwork

Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,16 @@ spring:
ddl-auto: update
naming:
physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
data:
redis:
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}

rate:
limiter:
max:
requests: 5
time:
window:
seconds: 60

0 comments on commit 2846f59

Please sign in to comment.