kabeerahmad commited on
Commit
fa23cdc
·
verified ·
1 Parent(s): be7dbe5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -12
Dockerfile CHANGED
@@ -1,25 +1,16 @@
1
- # Use an official Python runtime as a parent image
2
  FROM python:3.9
3
 
4
- # Create a non-root user and switch to it
 
 
5
  RUN useradd -m -u 1000 user
6
  USER user
7
-
8
- # Add local bin directory to PATH
9
  ENV PATH="/home/user/.local/bin:$PATH"
10
 
11
- # Set the working directory to /app
12
  WORKDIR /app
13
 
14
- # Copy the requirements file and install the dependencies
15
  COPY --chown=user ./requirements.txt requirements.txt
16
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
17
 
18
- # Copy the rest of the application
19
  COPY --chown=user . /app
20
-
21
- # Expose the port that your app runs on
22
- EXPOSE 7860
23
-
24
- # Run the FastAPI app with uvicorn on port 7860
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9
2
 
3
+ # Install system dependencies for OpenCV
4
+ RUN apt-get update && apt-get install -y libgl1-mesa-glx
5
+
6
  RUN useradd -m -u 1000 user
7
  USER user
 
 
8
  ENV PATH="/home/user/.local/bin:$PATH"
9
 
 
10
  WORKDIR /app
11
 
 
12
  COPY --chown=user ./requirements.txt requirements.txt
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
 
15
  COPY --chown=user . /app
 
 
 
 
 
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]