File tree 5 files changed +63
-5
lines changed
5 files changed +63
-5
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ POSTGRES_USER=user
9
9
POSTGRES_PASSWORD = secret
10
10
11
11
# Redis
12
- REDIS_HOST = redis
12
+ REDIS_HOST = inmemory
13
13
REDIS_PORT = 6379
14
14
REDIS_DB = 2
15
15
Original file line number Diff line number Diff line change @@ -65,3 +65,4 @@ model-generate: ## generate sqlalchemy models from database
65
65
.PHONY : docker-up-granian
66
66
docker-up-granian : # # Run project with compose and granian
67
67
docker compose -f granian-compose.yml up --remove-orphans
68
+ docker compose -f valkey-compose.yml up --remove-orphans
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ services:
44
44
timeout : 5s
45
45
retries : 5
46
46
47
- redis :
47
+ inmemory :
48
48
image : redis:latest
49
- container_name : fsap_redis
49
+ container_name : fsap_inmemory
50
50
ports :
51
51
- " 6379:6379"
52
52
env_file :
Original file line number Diff line number Diff line change @@ -38,9 +38,9 @@ services:
38
38
timeout : 5s
39
39
retries : 5
40
40
41
- redis :
41
+ inmemory :
42
42
image : redis:latest
43
- container_name : fsap_redis
43
+ container_name : fsap_inmemory
44
44
ports :
45
45
- " 6379:6379"
46
46
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