Spaces:
Sleeping
Sleeping
Commit ·
8a5bc1d
1
Parent(s): 730f191
fix: use python -m uvicorn
Browse files- Dockerfile +5 -14
Dockerfile
CHANGED
|
@@ -1,26 +1,17 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# Install Node.js for building static frontend if needed in future
|
| 4 |
-
RUN apt-get update && apt-get install -y curl && \
|
| 5 |
-
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 6 |
-
apt-get install -y nodejs && \
|
| 7 |
-
rm -rf /var/lib/apt/lists/*
|
| 8 |
-
|
| 9 |
-
# Create user for security
|
| 10 |
-
RUN useradd -m -u 1000 user
|
| 11 |
-
USER user
|
| 12 |
-
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
# Copy requirements and install Python dependencies
|
| 16 |
-
COPY
|
| 17 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 18 |
|
| 19 |
# Copy application
|
| 20 |
-
COPY
|
| 21 |
-
COPY
|
| 22 |
|
| 23 |
# Expose Hugging Face required port
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Copy requirements and install Python dependencies
|
| 6 |
+
COPY requirements.txt .
|
| 7 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 8 |
|
| 9 |
# Copy application
|
| 10 |
+
COPY app.py .
|
| 11 |
+
COPY data ./data
|
| 12 |
|
| 13 |
# Expose Hugging Face required port
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
+
# Use python -m uvicorn to ensure PATH is found
|
| 17 |
+
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|