juinkinn commited on
Commit
8b0e44c
·
1 Parent(s): 1536543

fix docker

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -14
Dockerfile CHANGED
@@ -1,18 +1,12 @@
1
- # Use official Python 3.9 image as the base
2
- FROM python:3.9-slim
3
 
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Copy requirements and install dependencies
8
- COPY requirements.txt .
9
- RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy the application code
12
- COPY app.py .
13
 
14
- # Expose the port FastAPI will run on
15
- EXPOSE 7860
16
 
17
- # Command to run the FastAPI app with Uvicorn
18
- CMD ["uvicorn", "app.py:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.9
 
2
 
3
+ RUN useradd -m -u 1000 user
4
+ USER user
 
 
 
 
5
 
6
+ WORKDIR /app
 
7
 
8
+ COPY --chown=user ./requirements.txt requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
10
 
11
+ COPY --chown=user . /app
12
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]