diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc1deb7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.9-slim + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +EXPOSE 3000 + +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"] \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..fa40845 --- /dev/null +++ b/main.py @@ -0,0 +1,11 @@ +from fastapi import FastAPI + +app = FastAPI() + +@app.get("/") +def read_root(): + return {"message": "Hello World"} + +if __name__ == "__main__": + import uvicorn + uvicorn.run(app, host="0.0.0.0", port=3000) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3ad1474 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi==0.120.2 +uvicorn==0.29.0 \ No newline at end of file