MoritzLaurer HF staff commited on
Commit
4940a54
1 Parent(s): c41baaa

Update Docker

Browse files
Files changed (1) hide show
  1. Docker +8 -17
Docker CHANGED
@@ -1,22 +1,13 @@
1
- # Use a lightweight Python image
2
- FROM python:3.9-slim
3
 
4
- # Set environment variables
5
- ENV PYTHONUNBUFFERED=1 \
6
- SHELL=/bin/bash
7
 
8
- # Set the working directory
9
  WORKDIR /app
10
 
11
- # Copy requirements.txt and install dependencies
12
- COPY requirements.txt .
13
- RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Copy the app.py file into the container
16
- COPY app.py .
17
-
18
- # Expose the default MLflow port
19
- EXPOSE 7860
20
-
21
- # Set the command to run the app
22
- CMD ["python", "app.py"]
 
1
+ FROM python:3.9
 
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", "7860"]