muzammil-eds commited on
Commit
ae7455e
·
1 Parent(s): 1bead67

Files added

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -10
Dockerfile CHANGED
@@ -2,24 +2,28 @@
2
  FROM python:3.12.3
3
  LABEL authors="muzammil"
4
 
5
- # Set the working directory inside the container
6
- WORKDIR /app
7
-
8
  # Set Hugging Face cache directory to /tmp/.cache (which should be writable)
9
  ENV HF_HOME="/tmp/.cache"
10
 
11
-
12
  # Install FFmpeg
13
  RUN apt-get update && apt-get install -y ffmpeg
14
 
15
- # Copy the current directory contents into the container at /app
16
- COPY . /app
17
 
18
- # Install any required dependencies
19
- RUN pip install -r requirements.txt
 
 
 
 
 
 
 
 
 
 
20
 
21
  # Expose the port Flask will run on
22
  EXPOSE 7860
23
 
24
- # Command to run the Flask app
25
- CMD ["python", "app.py"]
 
2
  FROM python:3.12.3
3
  LABEL authors="muzammil"
4
 
 
 
 
5
  # Set Hugging Face cache directory to /tmp/.cache (which should be writable)
6
  ENV HF_HOME="/tmp/.cache"
7
 
 
8
  # Install FFmpeg
9
  RUN apt-get update && apt-get install -y ffmpeg
10
 
 
 
11
 
12
+ RUN useradd -m -u 1000 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
+
21
+
22
+ # Install any required Python dependencies
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
 
25
  # Expose the port Flask will run on
26
  EXPOSE 7860
27
 
28
+ # Command to run Gunicorn in production
29
+ CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "app:app"]