Skip to content

Commit

Permalink
feat : added redis on docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
fredygerman committed Jan 25, 2025
1 parent 29665fb commit 6b86319
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docker/dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.8'
version: "3.8"

services:
db:
Expand All @@ -19,6 +19,18 @@ services:
timeout: 5s
retries: 5

redis:
image: redis:latest
ports:
- "6379:6379"
volumes:
- redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5

app:
build:
context: ../..
Expand All @@ -30,8 +42,11 @@ services:
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"

volumes:
db:
redis:

2 comments on commit 6b86319

@jurmy24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you're following Alvaros conventions which is good. I'm not an expert on Docker though so @alvaro-mazcu what do you think about this redis implementation for rate limiting within the docker container?

@jurmy24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, right now you've only integrated redis into the dev container, so when the user is running the project on docker locally. Though we also need to use redis in the deployed version that we host on Render. Do you still think its feasible to use redis locally within docker or is it best to use their api?

Please sign in to comment.