Spaces:
Runtime error
Runtime error
Commit
·
a19dc1e
1
Parent(s):
e4e7eb0
first
Browse files- Dockerfile +20 -0
- main.py +15 -0
- requirements.txt +36 -0
Dockerfile
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official Python base image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the requirements file to the working directory
|
8 |
+
COPY requirements.txt .
|
9 |
+
|
10 |
+
# Install the Python dependencies
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
# Copy the FastAPI application code to the working directory
|
14 |
+
COPY . .
|
15 |
+
|
16 |
+
# Expose the port that the FastAPI application will run on
|
17 |
+
EXPOSE 8000
|
18 |
+
|
19 |
+
# Start the FastAPI application
|
20 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
main.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
from fastapi.responses import FileResponse
|
3 |
+
|
4 |
+
|
5 |
+
app = FastAPI()
|
6 |
+
|
7 |
+
@app.get("/")
|
8 |
+
def read_root():
|
9 |
+
return FileResponse("static/index.html")
|
10 |
+
|
11 |
+
if __name__ == "__main__":
|
12 |
+
import uvicorn
|
13 |
+
uvicorn.run("main:app", host="0.0.0.0", port=8000)
|
14 |
+
|
15 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
annotated-types==0.7.0
|
2 |
+
anyio==4.4.0
|
3 |
+
certifi==2024.6.2
|
4 |
+
click==8.1.7
|
5 |
+
dnspython==2.6.1
|
6 |
+
email_validator==2.1.1
|
7 |
+
exceptiongroup==1.2.1
|
8 |
+
fastapi==0.111.0
|
9 |
+
fastapi-cli==0.0.4
|
10 |
+
h11==0.14.0
|
11 |
+
httpcore==1.0.5
|
12 |
+
httptools==0.6.1
|
13 |
+
httpx==0.27.0
|
14 |
+
idna==3.7
|
15 |
+
Jinja2==3.1.4
|
16 |
+
markdown-it-py==3.0.0
|
17 |
+
MarkupSafe==2.1.5
|
18 |
+
mdurl==0.1.2
|
19 |
+
orjson==3.10.3
|
20 |
+
pydantic==2.7.3
|
21 |
+
pydantic_core==2.18.4
|
22 |
+
Pygments==2.18.0
|
23 |
+
python-dotenv==1.0.1
|
24 |
+
python-multipart==0.0.9
|
25 |
+
PyYAML==6.0.1
|
26 |
+
rich==13.7.1
|
27 |
+
shellingham==1.5.4
|
28 |
+
sniffio==1.3.1
|
29 |
+
starlette==0.37.2
|
30 |
+
typer==0.12.3
|
31 |
+
typing_extensions==4.12.1
|
32 |
+
ujson==5.10.0
|
33 |
+
uvicorn==0.30.1
|
34 |
+
uvloop==0.19.0
|
35 |
+
watchfiles==0.22.0
|
36 |
+
websockets==12.0
|