Skip to content

Commit 45b32be

Browse files
committed
wip: granian
1 parent fb54128 commit 45b32be

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

granian-compose.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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: {}

0 commit comments

Comments
 (0)