Spaces:
Runtime error
Runtime error
Commit ·
46abd4d
1
Parent(s): afe8789
Fix Dockerfile: copy all files before uv sync
Browse files- Dockerfile +11 -9
Dockerfile
CHANGED
|
@@ -2,20 +2,22 @@ FROM python:3.12-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Install UV
|
| 6 |
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
| 7 |
|
| 8 |
-
# Copy
|
| 9 |
-
COPY
|
| 10 |
|
| 11 |
-
# Install dependencies
|
| 12 |
RUN uv sync --frozen --no-dev
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
# Expose port
|
| 18 |
-
EXPOSE 8000
|
| 19 |
|
| 20 |
# Run application
|
| 21 |
-
CMD ["uv", "run", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
gcc \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
# Install UV
|
| 11 |
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
| 12 |
|
| 13 |
+
# Copy ALL files first (including README.md)
|
| 14 |
+
COPY . .
|
| 15 |
|
| 16 |
+
# Install dependencies AFTER copying all files
|
| 17 |
RUN uv sync --frozen --no-dev
|
| 18 |
|
| 19 |
+
# Expose port (Hugging Face uses port 7860)
|
| 20 |
+
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# Run application
|
| 23 |
+
CMD ["uv", "run", "uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "7860"]
|