ManTea commited on
Commit
7c002cf
·
1 Parent(s): a59309d
Files changed (1) hide show
  1. Dockerfile +8 -14
Dockerfile CHANGED
@@ -1,19 +1,13 @@
1
  FROM python:3.11.10-bookworm
2
 
3
- # Set the working directory in the container
4
- WORKDIR /app
5
-
6
- # Copy the requirements file to the working directory
7
- COPY requirements.txt .
8
 
9
- # Install dependencies
10
- RUN pip install --no-cache-dir -r requirements.txt
11
-
12
- # Copy the rest of the app's code to the working directory
13
- COPY . .
14
 
15
- # Expose port 5000 to the outside world
16
- EXPOSE 5000
17
 
18
- # Command to run the Flask application
19
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000"]
 
1
  FROM python:3.11.10-bookworm
2
 
3
+ RUN useradd -m -u 1000 user
4
+ USER user
5
+ ENV PATH="/home/user/.local/bin:$PATH"
 
 
6
 
7
+ WORKDIR /app
 
 
 
 
8
 
9
+ COPY --chown=user ./requirements.txt requirements.txt
10
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
 
12
+ COPY --chown=user . /app
13
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000"]