Upload folder using huggingface_hub
Browse files- Dockerfile +3 -3
- README.md +1 -1
- openenv.yaml +1 -2
- server/app.py +1 -1
Dockerfile
CHANGED
|
@@ -75,8 +75,8 @@ ENV ENABLE_WEB_INTERFACE="true"
|
|
| 75 |
# Health check
|
| 76 |
# Use Python stdlib instead of curl so the probe works even if curl is absent.
|
| 77 |
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=5 \
|
| 78 |
-
CMD python -c "import os,urllib.request; port=os.getenv('PORT','
|
| 79 |
|
| 80 |
# Run the FastAPI server
|
| 81 |
-
# Respect PORT if the platform injects one; default to
|
| 82 |
-
CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port ${PORT:-
|
|
|
|
| 75 |
# Health check
|
| 76 |
# Use Python stdlib instead of curl so the probe works even if curl is absent.
|
| 77 |
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=5 \
|
| 78 |
+
CMD python -c "import os,urllib.request; port=os.getenv('PORT','7860'); r=urllib.request.urlopen(f'http://localhost:{port}/health', timeout=3); raise SystemExit(0 if r.status==200 else 1)"
|
| 79 |
|
| 80 |
# Run the FastAPI server
|
| 81 |
+
# Respect PORT if the platform injects one; default to 7860.
|
| 82 |
+
CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port ${PORT:-7860}"]
|
README.md
CHANGED
|
@@ -5,7 +5,7 @@ colorFrom: pink
|
|
| 5 |
colorTo: blue
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
-
app_port:
|
| 9 |
base_path: /web
|
| 10 |
tags:
|
| 11 |
- openenv
|
|
|
|
| 5 |
colorTo: blue
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
app_port: 7860
|
| 9 |
base_path: /web
|
| 10 |
tags:
|
| 11 |
- openenv
|
openenv.yaml
CHANGED
|
@@ -3,5 +3,4 @@ name: basic_openenv
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
-
port:
|
| 7 |
-
|
|
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
+
port: 7860
|
|
|
server/app.py
CHANGED
|
@@ -80,7 +80,7 @@ def main():
|
|
| 80 |
|
| 81 |
parser = argparse.ArgumentParser()
|
| 82 |
parser.add_argument("--host", type=str, default="0.0.0.0")
|
| 83 |
-
parser.add_argument("--port", type=int, default=
|
| 84 |
args = parser.parse_args()
|
| 85 |
|
| 86 |
uvicorn.run(app, host=args.host, port=args.port)
|
|
|
|
| 80 |
|
| 81 |
parser = argparse.ArgumentParser()
|
| 82 |
parser.add_argument("--host", type=str, default="0.0.0.0")
|
| 83 |
+
parser.add_argument("--port", type=int, default=7860)
|
| 84 |
args = parser.parse_args()
|
| 85 |
|
| 86 |
uvicorn.run(app, host=args.host, port=args.port)
|