Pujan-Dev commited on
Commit
1672398
·
verified ·
1 Parent(s): 6386bd6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -7
Dockerfile CHANGED
@@ -9,13 +9,15 @@ RUN apt-get update && apt-get install -y build-essential git && rm -rf /var/lib/
9
 
10
  # Copy all project files into the working directory
11
  COPY . .
 
 
 
 
12
 
13
- # Upgrade pip and install dependencies
14
- RUN pip install --upgrade pip && \
15
- pip install --no-cache-dir -r requirements.txt
16
 
17
- # Expose the port FastAPI will run on (update to match the port in your uvicorn command)
18
- EXPOSE 8000
19
 
20
- # Run the FastAPI app using uvicorn with 4 workers
21
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
9
 
10
  # Copy all project files into the working directory
11
  COPY . .
12
+ RUN useradd user
13
+ USER user
14
+ ENV HOME=/home/user \
15
+ PATH=/home/user/.local/bin:$PATH
16
 
17
+ WORKDIR $HOME/app
 
 
18
 
19
+ COPY --chown=user ./ $HOME/app
20
+ RUN pip install -r requirements.txt
21
 
22
+
23
+ CMD fastapi run --reload --host=0.0.0.0 --port=7860