Skip to content

Commit

Permalink
feat: setup fastapi server
Browse files Browse the repository at this point in the history
  • Loading branch information
youcefguichi committed Apr 28, 2024
1 parent 2f39f56 commit a476ed2
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore everything
**

# But include
!server.py
!requirements.txt

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.11.9-slim

WORKDIR /podbee/

RUN apt update && apt install -y curl wget inetutils-ping dnsutils telnet

COPY . .

RUN pip install -r requirements.txt

CMD uvicorn server:app --host 0.0.0.0 --port 80
3 changes: 0 additions & 3 deletions docker/Dockerfile

This file was deleted.

13 changes: 13 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
annotated-types==0.6.0
anyio==4.3.0
click==8.1.7
exceptiongroup==1.2.1
fastapi==0.110.2
h11==0.14.0
idna==3.7
pydantic==2.7.1
pydantic_core==2.18.2
sniffio==1.3.1
starlette==0.37.2
typing_extensions==4.11.0
uvicorn==0.29.0
10 changes: 10 additions & 0 deletions server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from fastapi import FastAPI
from fastapi.responses import JSONResponse

app = FastAPI()


@app.get("/")
async def hello():
message = {"message": "Thank you for using PodBee!"}
return JSONResponse(content=message, status_code=200)

0 comments on commit a476ed2

Please sign in to comment.