* Fastapi base Dockerfile * requirements.txt for fastapi project * Add documentation on how to run the application * Add entrypoint for fastapi application * Add docker-compose.yml for fastapi Signed-off-by: vjanz <valon.januzaj98@gmail.com>pull/170/head
parent
263ba37b97
commit
b7685ad15f
@ -0,0 +1,11 @@ |
|||||||
|
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9-slim |
||||||
|
|
||||||
|
WORKDIR /app |
||||||
|
|
||||||
|
RUN apt update |
||||||
|
|
||||||
|
COPY requirements.txt ./ |
||||||
|
RUN pip install --no-cache-dir -r requirements.txt |
||||||
|
|
||||||
|
COPY ./app ./app |
||||||
|
|
@ -0,0 +1,8 @@ |
|||||||
|
from fastapi import FastAPI |
||||||
|
|
||||||
|
app = FastAPI() |
||||||
|
|
||||||
|
|
||||||
|
@app.get("/") |
||||||
|
def hello_world(): |
||||||
|
return {"message": "OK"} |
@ -0,0 +1,10 @@ |
|||||||
|
services: |
||||||
|
api: |
||||||
|
build: . |
||||||
|
container_name: fastapi-application |
||||||
|
environment: |
||||||
|
PORT: 8000 |
||||||
|
ports: |
||||||
|
- '8000:8000' |
||||||
|
restart: "no" |
||||||
|
|
@ -0,0 +1,2 @@ |
|||||||
|
fastapi |
||||||
|
uvicorn |
Loading…
Reference in new issue