Spaces:
Sleeping
Sleeping
Rifat Azad commited on
Commit ·
44f9e3b
1
Parent(s): 4a152be
added new banner
Browse files- Dockerfile +2 -0
- logger.py +5 -8
- pydvpl_banner.png +0 -0
Dockerfile
CHANGED
|
@@ -8,6 +8,8 @@ COPY ./pydvpl_bot.py /code
|
|
| 8 |
|
| 9 |
COPY ./logger.py /code
|
| 10 |
|
|
|
|
|
|
|
| 11 |
RUN ls -ln /code
|
| 12 |
|
| 13 |
RUN chmod 775 /code
|
|
|
|
| 8 |
|
| 9 |
COPY ./logger.py /code
|
| 10 |
|
| 11 |
+
COPY ./pydvpl_banner.png /code
|
| 12 |
+
|
| 13 |
RUN ls -ln /code
|
| 14 |
|
| 15 |
RUN chmod 775 /code
|
logger.py
CHANGED
|
@@ -1,14 +1,11 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
-
import
|
| 3 |
-
from fastapi.responses import Response
|
| 4 |
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
@app.get("/")
|
| 8 |
async def read_root():
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
else:
|
| 14 |
-
return {"message": "Failed to fetch image from the URL"}
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
+
from fastapi.responses import FileResponse
|
|
|
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
|
| 6 |
@app.get("/")
|
| 7 |
async def read_root():
|
| 8 |
+
# Assuming your PNG file is named "image.png" and is in the same directory as your script
|
| 9 |
+
file_path = "image.png"
|
| 10 |
+
# Serve the image using FileResponse
|
| 11 |
+
return FileResponse(file_path, media_type="image/png")
|
|
|
|
|
|
pydvpl_banner.png
ADDED
|