Spaces:
Sleeping
Sleeping
copilot fixed docker file
Browse files- DockerFile → Dockerfile +11 -11
DockerFile → Dockerfile
RENAMED
|
@@ -10,10 +10,7 @@ ENV PATH="/home/user/.local/bin:$PATH"
|
|
| 10 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 11 |
ENV PYTHONUNBUFFERED=1
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
WORKDIR /app
|
| 15 |
-
|
| 16 |
-
# Temporarily become root to install system dependencies for OpenCV
|
| 17 |
USER root
|
| 18 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 19 |
build-essential \
|
|
@@ -23,15 +20,18 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 23 |
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
USER user
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
# Copy
|
| 31 |
-
COPY --chown=user ./backend /app
|
| 32 |
|
| 33 |
# Expose the specific port Hugging Face requires
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
-
# Launch the FastAPI server
|
| 37 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 10 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 11 |
ENV PYTHONUNBUFFERED=1
|
| 12 |
|
| 13 |
+
# Install system dependencies required by OpenCV and PyTorch image handling
|
|
|
|
|
|
|
|
|
|
| 14 |
USER root
|
| 15 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 16 |
build-essential \
|
|
|
|
| 20 |
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
USER user
|
| 22 |
|
| 23 |
+
# Work from the repository root so the backend package imports resolve correctly
|
| 24 |
+
WORKDIR /app
|
| 25 |
+
|
| 26 |
+
# Install Python dependencies from the backend package
|
| 27 |
+
COPY --chown=user ./backend/requirements.txt /app/backend/requirements.txt
|
| 28 |
+
RUN pip install --no-cache-dir --upgrade -r /app/backend/requirements.txt
|
| 29 |
|
| 30 |
+
# Copy the backend package into the image
|
| 31 |
+
COPY --chown=user ./backend /app/backend
|
| 32 |
|
| 33 |
# Expose the specific port Hugging Face requires
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
+
# Launch the FastAPI server from the backend package
|
| 37 |
+
CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "7860"]
|