Spaces:
Running
Running
Syed Arfan
Claude
commited on
Commit
·
b789b98
1
Parent(s):
2857363
Configure for Hugging Face Spaces deployment
Browse files- Changed port from 8000 to 7860 (HF Spaces requirement)
- Added HF Spaces metadata to README.md
- Increased health check start-period for model loading time
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Dockerfile +6 -6
- README.md +9 -0
Dockerfile
CHANGED
|
@@ -13,12 +13,12 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 13 |
# Copy application code
|
| 14 |
COPY src/ ./src/
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
EXPOSE
|
| 18 |
|
| 19 |
# Health check for production monitoring
|
| 20 |
-
HEALTHCHECK --interval=30s --timeout=3s --start-period=
|
| 21 |
-
CMD curl -f http://localhost:
|
| 22 |
|
| 23 |
-
# Command to run when container starts
|
| 24 |
-
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 13 |
# Copy application code
|
| 14 |
COPY src/ ./src/
|
| 15 |
|
| 16 |
+
# HF Spaces requires port 7860
|
| 17 |
+
EXPOSE 7860
|
| 18 |
|
| 19 |
# Health check for production monitoring
|
| 20 |
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s \
|
| 21 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 22 |
|
| 23 |
+
# Command to run when container starts (HF Spaces uses port 7860)
|
| 24 |
+
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Sentiment Analysis API
|
| 2 |
|
| 3 |

|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Sentiment Analysis API
|
| 3 |
+
emoji: 🎭
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
# Sentiment Analysis API
|
| 11 |
|
| 12 |

|