implemented rate limit and set up redis container
This commit is contained in:
+24
-3
@@ -12,7 +12,7 @@ services:
|
||||
init: true #Manage processes and reap zombies
|
||||
ipc: private #Inter-Process Communication (IPC) namespace for high-performance applications
|
||||
environment:
|
||||
- DB_HOST=psql
|
||||
- DB_HOST=psql #rewrite DB_HOST var to communicate inside the docker network
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ../src
|
||||
@@ -37,6 +37,8 @@ services:
|
||||
depends_on:
|
||||
psql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "80:8000"
|
||||
entrypoint: ["./entrypoint.sh", "--dev"]
|
||||
@@ -72,6 +74,8 @@ services:
|
||||
depends_on:
|
||||
psql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "80:8000"
|
||||
|
||||
@@ -98,8 +102,25 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
- "${DB_PORT}:5432"
|
||||
|
||||
redis:
|
||||
image: redis:latest
|
||||
profiles: ["prod", "dev", "redis"]
|
||||
container_name: redis
|
||||
init: true
|
||||
ipc: private
|
||||
ports:
|
||||
- '${REDIS_PORT}:6379'
|
||||
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}", "--appendonly", "yes"]
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping | grep PONG"]
|
||||
interval: 1s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
|
||||
networks:
|
||||
backend:
|
||||
name: "${BACKEND_NETWORK:-backend_network}"
|
||||
Reference in New Issue
Block a user