feat: add redis and redis settings
This commit is contained in:
parent
2dc50465ce
commit
a6c7819e36
@ -38,6 +38,11 @@ class DefaultSettings(BaseSettings):
|
|||||||
BROKER_PASSWORD: str = environ.get("BROKER_PASSWORD", "guest")
|
BROKER_PASSWORD: str = environ.get("BROKER_PASSWORD", "guest")
|
||||||
BROKER_RABBITMQ_VHOST: str = environ.get("BROKER_RABBITMQ_VHOST", "")
|
BROKER_RABBITMQ_VHOST: str = environ.get("BROKER_RABBITMQ_VHOST", "")
|
||||||
|
|
||||||
|
REDIS_HOST: str = environ.get("REDIS_HOST", "localhost")
|
||||||
|
REDIS_PORT: int = int(environ.get("REDIS_PORT", "6379"))
|
||||||
|
REDIS_DB: int = int(environ.get("REDIS_DB", "0"))
|
||||||
|
REDIS_PASSWORD: str = environ.get("REDIS_PASSWORD", "hackme")
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
# env_file = "../.env"
|
# env_file = "../.env"
|
||||||
env_file_encoding = "utf-8"
|
env_file_encoding = "utf-8"
|
||||||
|
@ -16,8 +16,19 @@ services:
|
|||||||
MYSQL_USER: connect
|
MYSQL_USER: connect
|
||||||
MYSQL_PASSWORD: hackme
|
MYSQL_PASSWORD: hackme
|
||||||
volumes:
|
volumes:
|
||||||
- data:/var/lib/mysql
|
- mysql_data:/var/lib/mysql
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
container_name: redis
|
||||||
|
command: redis-server --requirepass password
|
||||||
|
environment:
|
||||||
|
REDIS_PASSWORD: hackme
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
- redis_data:/data
|
||||||
|
volumes:
|
||||||
|
mysql_data:
|
||||||
|
redis_data:
|
@ -16,7 +16,11 @@ environment=
|
|||||||
BROKER_USER=guest,
|
BROKER_USER=guest,
|
||||||
BROKER_PORT=5672,
|
BROKER_PORT=5672,
|
||||||
BROKER_PASSWORD=guest,
|
BROKER_PASSWORD=guest,
|
||||||
BROKER_RABBITMQ_VHOST=/
|
BROKER_RABBITMQ_VHOST=/,
|
||||||
|
REDIS_HOST=localhsot,
|
||||||
|
REDIS_PORT=6379,
|
||||||
|
REDIS_PASSWORD=hackme,
|
||||||
|
REDIS_DB=0
|
||||||
command=bash -c 'cd api; poetry run python3 -m api'
|
command=bash -c 'cd api; poetry run python3 -m api'
|
||||||
numprocs=1
|
numprocs=1
|
||||||
process_name=uvicorn-%(process_num)d
|
process_name=uvicorn-%(process_num)d
|
||||||
|
Loading…
Reference in New Issue
Block a user