mobadara commited on
Commit
c7003e9
·
1 Parent(s): 13f211f

copilot fixed docker file

Browse files
Files changed (1) hide show
  1. 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
- # This creates the /app folder INSIDE the virtual container
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
- # 🚨 TARGETED COPYING: We specifically grab files from your local 'backend' folder
27
- COPY --chown=user ./backend/requirements.txt requirements.txt
28
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
29
 
30
- # Copy everything else from the local 'backend' folder into the container's /app folder
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"]