File tree Expand file tree Collapse file tree 6 files changed +67
-5
lines changed Expand file tree Collapse file tree 6 files changed +67
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ POSTGRES_USER=user
99POSTGRES_PASSWORD = secret
1010
1111# Redis
12- REDIS_HOST = redis
12+ REDIS_HOST = inmemory
1313REDIS_PORT = 6379
1414REDIS_DB = 2
1515
Original file line number Diff line number Diff line change @@ -65,3 +65,7 @@ model-generate: ## generate sqlalchemy models from database
6565.PHONY : docker-up-granian
6666docker-up-granian : # # Run project with compose and granian
6767 docker compose -f granian-compose.yml up --remove-orphans
68+
69+ .PHONY : docker-up-valkey
70+ docker-up-valkey : # # Run project with compose and valkey
71+ docker compose -f valkey-compose.yml up --remove-orphans
Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ I've included a few of my favorites to kick things off!
166166* [ Connection pool for asyncpg] ( https://magicstack.github.io/asyncpg/current/usage.html#connection-pools )
167167* [ Granian - A Rust HTTP server for Python applications] ( https://github.com/emmett-framework/granian )
168168* [ APScheduler - In-process task scheduler with Cron-like capabilities] ( https://apscheduler.readthedocs.io/en/master/ )
169+ * [ Valkey - A simple and fast key-value store] ( https://github.com/valkey-io/valkey )
169170
170171<p align =" right " >(<a href =" #readme-top " >back to top</a >)</p >
171172
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ services:
4444 timeout : 5s
4545 retries : 5
4646
47- redis :
47+ inmemory :
4848 image : redis:latest
49- container_name : fsap_redis
49+ container_name : fsap_inmemory
5050 ports :
5151 - " 6379:6379"
5252 env_file :
Original file line number Diff line number Diff line change @@ -38,9 +38,9 @@ services:
3838 timeout : 5s
3939 retries : 5
4040
41- redis :
41+ inmemory :
4242 image : redis:latest
43- container_name : fsap_redis
43+ container_name : fsap_inmemory
4444 ports :
4545 - " 6379:6379"
4646 env_file :
Original file line number Diff line number Diff line change 1+ services :
2+ app :
3+ container_name : fsap_app
4+ build : .
5+ env_file :
6+ - .env
7+ - .secrets
8+ command : bash -c "
9+ uvicorn app.main:app
10+ --log-config ./logging-uvicorn.json
11+ --host 0.0.0.0 --port 8080
12+ --lifespan=on --use-colors --loop uvloop --http httptools
13+ --reload --log-level debug
14+ "
15+ volumes:
16+ - .:/home/code
17+ ports:
18+ - " 8080:8080"
19+ depends_on :
20+ - db
21+ - valkey
22+
23+ db :
24+ container_name : fsap_db
25+ build :
26+ context : ./db
27+ dockerfile : Dockerfile
28+ volumes :
29+ - fastapi_postgres_data:/var/lib/postgresql/data
30+ env_file :
31+ - .env
32+ ports :
33+ - 5432:5432
34+ environment :
35+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
36+ - POSTGRES_USER=${POSTGRES_USER?Variable not set}
37+ - POSTGRES_DB=${POSTGRES_DB?Variable not set}
38+ healthcheck :
39+ test :
40+ [
41+ " CMD-SHELL" , "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER"
42+ ]
43+ interval : 5s
44+ timeout : 5s
45+ retries : 5
46+
47+ inmemory :
48+ image : valkey/valkey:latest
49+ container_name : fsap_inmemory
50+ ports :
51+ - " 6379:6379"
52+ env_file :
53+ - .env
54+ entrypoint : valkey-server --loglevel verbose
55+
56+ volumes :
57+ fastapi_postgres_data : {}
You can’t perform that action at this time.
0 commit comments