File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ version : ' 3.9'
2+
3+ services :
4+ app :
5+ container_name : fsap_app
6+ build : .
7+ env_file :
8+ - .env
9+ - .secrets
10+ command : granian --interface asgi --host 0.0.0.0 --port 8080 --loop uvloop app.main:app
11+ volumes :
12+ - .:/home/code
13+ ports :
14+ - " 8080:8080"
15+ depends_on :
16+ - db
17+ - redis
18+
19+ db :
20+ container_name : fsap_db
21+ build :
22+ context : ./db
23+ dockerfile : Dockerfile
24+ volumes :
25+ - fastapi_postgres_data:/var/lib/postgresql/data
26+ env_file :
27+ - .env
28+ ports :
29+ - 5432:5432
30+ environment :
31+ - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set}
32+ - POSTGRES_USER=${POSTGRES_USER?Variable not set}
33+ - POSTGRES_DB=${POSTGRES_DB?Variable not set}
34+ healthcheck :
35+ test :
36+ [
37+ " CMD-SHELL" , "pg_isready -d $POSTGRES_DB -U $POSTGRES_USER"
38+ ]
39+ interval : 5s
40+ timeout : 5s
41+ retries : 5
42+
43+ redis :
44+ image : redis:latest
45+ container_name : fsap_redis
46+ ports :
47+ - " 6379:6379"
48+ env_file :
49+ - .env
50+ entrypoint : redis-server --appendonly yes
51+
52+ volumes :
53+ fastapi_postgres_data : {}
You can’t perform that action at this time.
0 commit comments