trivial
Browse files- Dockerfile +1 -1
- app.py → main.py +2 -2
- requirements-local.txt +3 -0
Dockerfile
CHANGED
|
@@ -8,4 +8,4 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
| 8 |
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
-
CMD ["uvicorn", "
|
|
|
|
| 8 |
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]
|
app.py → main.py
RENAMED
|
@@ -20,11 +20,11 @@ def test():
|
|
| 20 |
@app.get("/info_sync")
|
| 21 |
def info_sync():
|
| 22 |
print(f"[{datetime.now()}] sync")
|
| 23 |
-
time.sleep(5)
|
| 24 |
return {"message": "sync"}
|
| 25 |
|
| 26 |
@app.get("/info_async")
|
| 27 |
async def info_async():
|
| 28 |
print(f"[{datetime.now()}] async")
|
| 29 |
-
await asyncio.sleep(5)
|
| 30 |
return {"message": "async"}
|
|
|
|
| 20 |
@app.get("/info_sync")
|
| 21 |
def info_sync():
|
| 22 |
print(f"[{datetime.now()}] sync")
|
| 23 |
+
time.sleep(0.5)
|
| 24 |
return {"message": "sync"}
|
| 25 |
|
| 26 |
@app.get("/info_async")
|
| 27 |
async def info_async():
|
| 28 |
print(f"[{datetime.now()}] async")
|
| 29 |
+
await asyncio.sleep(0.5)
|
| 30 |
return {"message": "async"}
|
requirements-local.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi
|
| 2 |
+
uvicorn[standard]
|
| 3 |
+
git+ssh://github.com/east-and-west-magic/pgsoft.git@tag-2023-11-25-a
|