Skip to content

Commit d6824ae

Browse files
committed
initialise app
0 parents  commit d6824ae

13 files changed

Lines changed: 434 additions & 0 deletions

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__pycache__/
2+
venv/
3+
.env
4+
*.pyc
5+
.coverage
6+
.vscode/
7+
docker/

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
__pycache__/
2+
venv/
3+
.venv/
4+
.env
5+
*.pyc
6+
.coverage
7+
.vscode/
8+
.DS_Store
9+
.idea/
10+
.pytest_cache/

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM python:3.10
2+
3+
WORKDIR /app
4+
5+
ENV DEBIAN_FRONTEND='noninteractive'
6+
7+
RUN apt-get update && apt install -y curl
8+
9+
RUN pip install poetry
10+
11+
ENV PATH="${PATH}:/root/.local/bin"
12+
13+
COPY ./pyproject.toml /app/pyproject.toml
14+
15+
COPY ./poetry.lock /app/poetry.lock
16+
17+
18+
RUN poetry install
19+
20+
COPY . /app
21+
22+
EXPOSE 8000
23+
24+
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
25+

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Database API

app/__init__.py

Whitespace-only changes.

app/controllers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from fastapi import APIRouter
2+
3+
router = APIRouter()
4+
5+
6+
@router.get("/", tags=["index"])
7+
def index_route():
8+
return {"Hello": "Dashboard"}

app/model.py

Whitespace-only changes.

app/tests.py

Whitespace-only changes.

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: "3"
2+
services:
3+
database-api:
4+
restart: always
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
container_name: database-api
9+
environment:
10+
PYTHONDONTWRITEBYTECODE: 1
11+
PYTHONUNBUFFERED: 1
12+
ports:
13+
- "${APP_PORT:-8000}:8000"
14+
volumes:
15+
- .:/app
16+

main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from typing import Union
2+
3+
from fastapi import FastAPI
4+
from app.controllers import router
5+
6+
app = FastAPI()
7+
8+
app.include_router(router, prefix="/api")

0 commit comments

Comments
 (0)