diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..93526df --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv/ +__pycache__/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fa3d8c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.11-alpine + +WORKDIR /code + +COPY requirements.txt . + +RUN pip install --no-cache-dir --upgrade -r requirements.txt + +COPY ./app /code + +EXPOSE 8000 + +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/app/main.py b/app/main.py new file mode 100644 index 0000000..4c0e650 --- /dev/null +++ b/app/main.py @@ -0,0 +1,15 @@ +import fastapi +import uvicorn + + +app = fastapi.FastAPI() + + +@app.get("/") +async def root(): + return {"message": "Hello World"} + + +if __name__ == "__main__": + uvicorn.run(app, host="0.0.0.0", port=8000) + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..1ea5ec9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi~=0.115.8 +uvicorn~=0.34.0