Muhammadidrees commited on
Commit
e1b1f98
·
verified ·
1 Parent(s): f043df3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -41
Dockerfile CHANGED
@@ -1,16 +1,10 @@
1
- # ---------------------------
2
- # 1️⃣ Base image
3
- # ---------------------------
4
- FROM python:3.11-slim
5
-
6
- # ---------------------------
7
- # 2️⃣ Set working directory
8
- # ---------------------------
9
  WORKDIR /home/user/app
10
 
11
- # ---------------------------
12
- # 3️⃣ System dependencies
13
- # ---------------------------
14
  RUN apt-get update && apt-get install -y \
15
  git \
16
  git-lfs \
@@ -20,34 +14,24 @@ RUN apt-get update && apt-get install -y \
20
  cmake \
21
  rsync \
22
  libgl1 \
23
- curl \
24
- && rm -rf /var/lib/apt/lists/* \
25
- && git lfs install
26
-
27
- # ---------------------------
28
- # 4️⃣ Copy requirements
29
- # ---------------------------
30
- COPY requirements.txt /tmp/requirements.txt
31
-
32
- # ---------------------------
33
- # 5️⃣ Install Python dependencies (upgrade pip & clear cache)
34
- # ---------------------------
35
- RUN pip install --upgrade pip \
36
- && pip cache purge \
37
- && pip install --no-cache-dir -r /tmp/requirements.txt
38
-
39
- # ---------------------------
40
- # 6️⃣ Copy app code
41
- # ---------------------------
42
- COPY . /home/user/app
43
-
44
- # ---------------------------
45
- # 7️⃣ Set user (optional)
46
- # ---------------------------
47
- RUN useradd -m -u 1000 user
48
- USER user
49
-
50
- # ---------------------------
51
- # 8️⃣ Default command
52
- # ---------------------------
53
  CMD ["python", "app.py"]
 
1
+ # Use Python 3.10 as base
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
 
 
 
 
5
  WORKDIR /home/user/app
6
 
7
+ # Install system dependencies
 
 
8
  RUN apt-get update && apt-get install -y \
9
  git \
10
  git-lfs \
 
14
  cmake \
15
  rsync \
16
  libgl1 \
17
+ portaudio19-dev \
18
+ && rm -rf /var/lib/apt/lists/* \
19
+ && git lfs install
20
+
21
+ # Upgrade pip and clear cache
22
+ RUN pip install --upgrade pip && pip cache purge
23
+
24
+ # Copy requirements
25
+ COPY requirements.txt .
26
+
27
+ # Install Python dependencies
28
+ RUN pip install --no-cache-dir -r requirements.txt
29
+
30
+ # Copy all project files into container
31
+ COPY . .
32
+
33
+ # Expose port (for Gradio app if you run it)
34
+ EXPOSE 7860
35
+
36
+ # Run the app
 
 
 
 
 
 
 
 
 
 
37
  CMD ["python", "app.py"]