Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +31 -38
Dockerfile
CHANGED
|
@@ -1,38 +1,31 @@
|
|
| 1 |
-
FROM python:3.10-slim
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
# Install curl for health checks
|
| 6 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
-
curl \
|
| 8 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
-
|
| 10 |
-
# Copy requirements and install dependencies
|
| 11 |
-
COPY requirements.txt .
|
| 12 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
-
|
| 14 |
-
# Copy application files
|
| 15 |
-
COPY edgar_client.py .
|
| 16 |
-
COPY financial_analyzer.py .
|
| 17 |
-
COPY mcp_server.py .
|
| 18 |
-
|
| 19 |
-
# Expose port
|
| 20 |
-
EXPOSE 7860
|
| 21 |
-
|
| 22 |
-
# Set environment variables for production
|
| 23 |
-
ENV PYTHONUNBUFFERED=1
|
| 24 |
-
ENV PYTHONDONTWRITEBYTECODE=1
|
| 25 |
-
|
| 26 |
-
# Health check for container monitoring
|
| 27 |
-
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
| 28 |
-
CMD curl -f http://localhost:7860/health || exit 1
|
| 29 |
-
|
| 30 |
-
# Run with optimized settings for HF CPU Upgrade
|
| 31 |
-
CMD ["uvicorn", "mcp_server:app",
|
| 32 |
-
"--host", "0.0.0.0", \
|
| 33 |
-
"--port", "7860", \
|
| 34 |
-
"--workers", "2", \
|
| 35 |
-
"--timeout-keep-alive", "75", \
|
| 36 |
-
"--limit-concurrency", "200", \
|
| 37 |
-
"--backlog", "2048", \
|
| 38 |
-
"--log-level", "info"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install curl for health checks
|
| 6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
+
curl \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Copy requirements and install dependencies
|
| 11 |
+
COPY requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Copy application files
|
| 15 |
+
COPY edgar_client.py .
|
| 16 |
+
COPY financial_analyzer.py .
|
| 17 |
+
COPY mcp_server.py .
|
| 18 |
+
|
| 19 |
+
# Expose port
|
| 20 |
+
EXPOSE 7860
|
| 21 |
+
|
| 22 |
+
# Set environment variables for production
|
| 23 |
+
ENV PYTHONUNBUFFERED=1
|
| 24 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 25 |
+
|
| 26 |
+
# Health check for container monitoring
|
| 27 |
+
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
| 28 |
+
CMD curl -f http://localhost:7860/health || exit 1
|
| 29 |
+
|
| 30 |
+
# Run with optimized settings for HF CPU Upgrade
|
| 31 |
+
CMD ["uvicorn", "mcp_server:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "75", "--limit-concurrency", "200", "--log-level", "info"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|