sreepathi-ravikumar commited on
Commit
021ed1d
·
verified ·
1 Parent(s): 99b4bd9

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Set up a new user named "user" with user ID 1000
4
+ RUN useradd -m -u 1000 user
5
+
6
+ # Install system dependencies for audio processing
7
+ RUN apt-get update && apt-get install -y \
8
+ ffmpeg \
9
+ libsndfile1 \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Switch to the "user" user
13
+ USER user
14
+
15
+ # Set environment variables
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH \
18
+ PYTHONUNBUFFERED=1
19
+
20
+ # Set the working directory
21
+ WORKDIR $HOME/app
22
+
23
+ # Copy requirements and install dependencies
24
+ COPY --chown=user requirements.txt .
25
+ RUN pip install --no-cache-dir --upgrade pip && \
26
+ pip install --no-cache-dir -r requirements.txt
27
+
28
+ # Copy application files
29
+ COPY --chown=user . .
30
+
31
+ # Create audio output directory
32
+ RUN mkdir -p $HOME/app/audio_output && chmod 777 $HOME/app/audio_output
33
+
34
+ # Expose port 7860 (required by Hugging Face Spaces)
35
+ EXPOSE 7860
36
+
37
+ # Run the Flask application
38
+ CMD ["python", "app.py"]