set redis
This commit is contained in:
@@ -25,6 +25,24 @@ services:
|
||||
networks:
|
||||
- psp_consumer_network
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
platform: ${DOCKER_PLATFORM:-linux/amd64}
|
||||
container_name: psp_consumer_api_redis
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- psp_consumer_network
|
||||
|
||||
api:
|
||||
platform: ${DOCKER_PLATFORM:-linux/amd64}
|
||||
build:
|
||||
@@ -51,6 +69,8 @@ services:
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
NODE_ENV: ${NODE_ENV:-production}
|
||||
PORT: ${PORT}
|
||||
@@ -65,6 +85,10 @@ services:
|
||||
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN}
|
||||
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:5000,http://127.0.0.1:5000}
|
||||
OTP_STATIC_CODE: ${OTP_STATIC_CODE} # From .env
|
||||
REDIS_HOST: ${REDIS_HOST:-redis}
|
||||
REDIS_PORT: ${REDIS_PORT:-6379}
|
||||
REDIS_DB: ${REDIS_DB:-0}
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
|
||||
ports:
|
||||
- "${PORT:-5002}:5002"
|
||||
read_only: true
|
||||
@@ -135,6 +159,8 @@ services:
|
||||
volumes:
|
||||
db_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
psp_consumer_network:
|
||||
|
||||
Reference in New Issue
Block a user