Spaces:
Paused
Paused
Commit
·
072ce62
1
Parent(s):
3ef0e67
feat: temp using test server
Browse files- Dockerfile +2 -1
- test_server.py +16 -0
Dockerfile
CHANGED
@@ -15,6 +15,7 @@ ENV PATH /app/miniconda/bin:$PATH
|
|
15 |
|
16 |
SHELL ["conda", "run","--no-capture-output", "-p","/app/env", "/bin/bash", "-c"]
|
17 |
|
|
|
18 |
COPY --chown=1000:1000 ./web_server.py /app/web_server.py
|
19 |
COPY --chown=1000:1000 ./docker/web_server_config/scene-0383-medium-00.yaml /app/docker/web_server_config/scene-0383-medium-00.yaml
|
20 |
COPY --chown=1000:1000 ./download_pre_datas.py /app/download_pre_datas.py
|
@@ -30,4 +31,4 @@ RUN ./.pixi/envs/default/bin/python /app/download_pre_datas.py
|
|
30 |
|
31 |
EXPOSE 7860
|
32 |
|
33 |
-
CMD ["./.pixi/envs/default/bin/python", "
|
|
|
15 |
|
16 |
SHELL ["conda", "run","--no-capture-output", "-p","/app/env", "/bin/bash", "-c"]
|
17 |
|
18 |
+
COPY --chown=1000:1000 ./test_server.py /app/test_server.py
|
19 |
COPY --chown=1000:1000 ./web_server.py /app/web_server.py
|
20 |
COPY --chown=1000:1000 ./docker/web_server_config/scene-0383-medium-00.yaml /app/docker/web_server_config/scene-0383-medium-00.yaml
|
21 |
COPY --chown=1000:1000 ./download_pre_datas.py /app/download_pre_datas.py
|
|
|
31 |
|
32 |
EXPOSE 7860
|
33 |
|
34 |
+
CMD ["./.pixi/envs/default/bin/python", "test_server.py"]
|
test_server.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import uvicorn
|
2 |
+
from fastapi import FastAPI
|
3 |
+
|
4 |
+
class Temp:
|
5 |
+
def __init__(self):
|
6 |
+
self.app = FastAPI()
|
7 |
+
self.app.add_api_route("/", self.index, methods=["GET"])
|
8 |
+
|
9 |
+
async def index(self):
|
10 |
+
return {"message": "Hello, World!"}
|
11 |
+
|
12 |
+
def run(self):
|
13 |
+
uvicorn.run(self.app, port=7860, workers=1)
|
14 |
+
|
15 |
+
|
16 |
+
Temp().run()
|