Spaces:
Runtime error
Runtime error
First commit
Browse files- Dockerfile +13 -0
- main.py +14 -0
- requirements.txt +1 -0
Dockerfile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
+
|
| 3 |
+
WORKDIR /code
|
| 4 |
+
|
| 5 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
+
|
| 7 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 8 |
+
|
| 9 |
+
RUN echo "Hello world!!!"
|
| 10 |
+
|
| 11 |
+
COPY . .
|
| 12 |
+
|
| 13 |
+
CMD ["uvicorn", "main:app", "--host", "127.0.0.1", "--port", "7860"]
|
main.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
async def app(scope, receive, send):
|
| 2 |
+
assert scope['type'] == 'http'
|
| 3 |
+
|
| 4 |
+
await send({
|
| 5 |
+
'type': 'http.response.start',
|
| 6 |
+
'status': 200,
|
| 7 |
+
'headers': [
|
| 8 |
+
[b'content-type', b'text/plain'],
|
| 9 |
+
],
|
| 10 |
+
})
|
| 11 |
+
await send({
|
| 12 |
+
'type': 'http.response.body',
|
| 13 |
+
'body': b'Hello, world!',
|
| 14 |
+
})
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
uvicorn
|