Soutrik commited on
Commit
a3f0b6e
·
1 Parent(s): 9c32722

added: basic arrangement of api and basic docker compose

Browse files
.env ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ POSTGRES_DB=test_db
2
+ POSTGRES_USER=test_user
3
+ POSTGRES_PASSWORD=test_pass
4
+ REDIS_PORT=6379
5
+ REDIS_HOST=redis
6
+ FLOWER_BASIC_AUTH=flower_user:flower_pass
7
+ REDIS_URL=redis://redis:6379/0
8
+ DATABASE_URL=postgresql+asyncpg://test_user:test_pass@postgres:5432/test_db
9
+ BROKER_URL=redis://redis:6379/0
10
+
app/api/__init__.py ADDED
File without changes
app/core/__init__.py ADDED
File without changes
app/crud/__init__.py ADDED
File without changes
app/db/__init__.py ADDED
File without changes
app/schemas/__init__.py ADDED
File without changes
app/tasks/__init__.py ADDED
File without changes
docker-compose.yaml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.8'
2
+
3
+ services:
4
+ postgres:
5
+ image: postgres:16-alpine
6
+ environment:
7
+ POSTGRES_DB: ${POSTGRES_DB}
8
+ POSTGRES_USER: ${POSTGRES_USER}
9
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
10
+ ports:
11
+ - "5432:5432"
12
+ volumes:
13
+ - postgres_data:/var/lib/postgresql/data
14
+ healthcheck:
15
+ test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
16
+ interval: 30s
17
+ timeout: 10s
18
+ retries: 5
19
+
20
+ redis:
21
+ image: redis/redis-stack:latest
22
+ ports:
23
+ - "6379:6379"
24
+ - "8001:8001"
25
+ healthcheck:
26
+ test: ["CMD", "redis-cli", "ping"]
27
+ interval: 30s
28
+ timeout: 5s
29
+ retries: 5
30
+
31
+ flower:
32
+ image: mher/flower:0.9.7
33
+ command: ["flower", "--broker=${BROKER_URL}", "--port=5555"]
34
+ ports:
35
+ - 5557:5555
36
+ depends_on:
37
+ - redis
38
+
39
+ volumes:
40
+ postgres_data:
41
+
42
+ networks:
43
+ my_network:
44
+ driver: bridge
poetry.lock ADDED
The diff for this file is too large to render. See raw diff
 
pyproject.toml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.poetry]
2
+ name = "fastapi-aws-template"
3
+ version = "0.1.0"
4
+ description = "Basic template testing pytorch fastapi application on aws infra using GHA"
5
+ authors = ["Soutrik Chowdhury"]
6
+ license = "Apache-2.0"
7
+ readme = "README.md"
8
+ package-mode = false
9
+
10
+ [tool.poetry.dependencies]
11
+ python = "3.10.15"
12
+ fastapi = "^0.115.4"
13
+ loguru = "^0.7.2"
14
+ fastapi-utils = "^0.7.0"
15
+ httpx = "^0.27.2"
16
+ typing-inspect = "^0.9.0"
17
+ requests = "^2.32.3"
18
+ pydantic = "^2.9.2"
19
+ pydantic-settings = "^2.6.1"
20
+ uvicorn = "^0.32.0"
21
+ fastapi-restful = {extras = ["all"], version = "^0.6.0"}
22
+ aioredis = "^2.0.1"
23
+ tenacity = "^9.0.0"
24
+ psycopg2-binary = "^2.9.10"
25
+ asyncpg = "^0.30.0"
26
+ confluent-kafka = "^2.6.0"
27
+ aiokafka = "^0.12.0"
28
+ azure-servicebus = "^7.12.3"
29
+ aiohttp = "^3.10.10"
30
+ gunicorn = "^23.0.0"
31
+ aiofiles = "^24.1.0"
32
+ aiologger = "^0.7.0"
33
+ pyyaml = "^6.0.2"
34
+ sqlalchemy-utils = "^0.41.2"
35
+ sqlalchemy = "^2.0.36"
36
+ alembic = "^1.13.3"
37
+ fastapi-limiter = "^0.1.6"
38
+ redis = "5.0.8"
39
+ redisearch = "2.0.0"
40
+ pandas = "^2.2.3"
41
+ python-multipart = "^0.0.17"
42
+ python-dotenv = "^1.0.1"
43
+
44
+
45
+ [build-system]
46
+ requires = ["poetry-core"]
47
+ build-backend = "poetry.core.masonry.api"