MalikShehram commited on
Commit
90027d3
·
verified ·
1 Parent(s): ab83666

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /code
6
+
7
+ # Install system dependencies (ffmpeg is required for Whisper/Gradio audio processing)
8
+ RUN apt-get update && apt-get install -y \
9
+ git \
10
+ ffmpeg \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Copy the requirements file into the container
14
+ COPY ./requirements.txt /code/requirements.txt
15
+
16
+ # Install Python dependencies
17
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
18
+
19
+ # Set up a non-root user (Required by Hugging Face Spaces)
20
+ RUN useradd -m -u 1000 user
21
+ USER user
22
+ ENV HOME=/home/user \
23
+ PATH=/home/user/.local/bin:$PATH
24
+
25
+ # Change working directory to the user's home directory
26
+ WORKDIR $HOME/app
27
+
28
+ # Copy the application code
29
+ COPY --chown=user . $HOME/app
30
+
31
+ # Expose the port Gradio runs on
32
+ EXPOSE 7860
33
+
34
+ # Command to run the application
35
+ CMD ["python", "app.py"]