iremrit commited on
Commit
aecca3a
·
verified ·
1 Parent(s): 2d1fa8d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -6
Dockerfile CHANGED
@@ -1,4 +1,3 @@
1
- # Use official Python image
2
  FROM python:3.10-slim
3
 
4
  # Create a user
@@ -8,15 +7,18 @@ USER user
8
  # Set working directory
9
  WORKDIR /app
10
 
11
- # Copy requirements and install
12
- COPY --chown=user requirements.txt .
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- # Copy all files to container
16
- COPY --chown=user . .
17
 
18
  # Set environment variable for FastAPI port
19
  ENV PORT=7860
20
 
 
 
 
21
  # Run the FastAPI app
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.10-slim
2
 
3
  # Create a user
 
7
  # Set working directory
8
  WORKDIR /app
9
 
10
+ # Copy requirements and install globally
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir --upgrade --break-system-packages -r requirements.txt
13
 
14
+ # Copy all files
15
+ COPY . .
16
 
17
  # Set environment variable for FastAPI port
18
  ENV PORT=7860
19
 
20
+ # Ensure uvicorn is in PATH
21
+ ENV PATH="/home/user/.local/bin:$PATH"
22
+
23
  # Run the FastAPI app
24
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]