-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 851 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM python:3.11-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy dependency files first (better layer caching)
COPY requirements.txt pyproject.toml ./
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code (excludes everything in .dockerignore)
COPY . .
# Expose the port HF Spaces expects
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl --fail http://localhost:7860/health || exit 1
# Set PYTHONPATH to include the root directory so server/app.py can import root modules
ENV PYTHONPATH=/app
# Run the server
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
# Force rebuild: fix boundary clamping v2