sachin commited on
Commit
3720aac
·
1 Parent(s): ee7323a
Files changed (3) hide show
  1. Dockerfile +35 -1
  2. Dockerfile.app +0 -18
  3. Dockerfile.base +5 -1
Dockerfile CHANGED
@@ -1,6 +1,40 @@
1
- FROM slabstech/dhwani-model-server
 
2
  WORKDIR /app
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ENV HF_HOME=/data/huggingface
5
  # Expose port
6
  EXPOSE 7860
 
1
+ # Base image with CUDA support
2
+ FROM nvidia/cuda:12.8.0-cudnn-devel-ubuntu22.04 AS model-downloader
3
  WORKDIR /app
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ python3 \
8
+ python3-pip python3-distutils python3-dev python3-venv \
9
+ git \
10
+ ffmpeg \
11
+ sudo wget curl software-properties-common build-essential gcc g++ \
12
+ && ln -s /usr/bin/python3 /usr/bin/python \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Install Rust
16
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
17
+ ENV PATH="/root/.cargo/bin:${PATH}"
18
+
19
+ # Set compiler environment variables
20
+ ENV CC=/usr/bin/gcc
21
+ ENV CXX=/usr/bin/g++
22
+
23
+ # Upgrade pip and install base Python dependencies
24
+ RUN pip install --upgrade pip setuptools setuptools-rust torch
25
+ RUN pip install flash-attn --no-build-isolation
26
+
27
+ # Copy requirements and configuration files
28
+ COPY requirements.txt .
29
+
30
+ # Install Python dependencies
31
+ RUN pip install --no-cache-dir -r requirements.txt
32
+
33
+ # Set up user
34
+ RUN useradd -ms /bin/bash appuser \
35
+ && chown -R appuser:appuser /app
36
+ USER appuser
37
+ COPY . .
38
  ENV HF_HOME=/data/huggingface
39
  # Expose port
40
  EXPOSE 7860
Dockerfile.app DELETED
@@ -1,18 +0,0 @@
1
- FROM slabstech/dhwani-server-base
2
- WORKDIR /app
3
-
4
- ENV HF_HOME=/data/huggingface
5
- COPY . .
6
-
7
- # Set up user
8
- RUN useradd -ms /bin/bash appuser \
9
- && chown -R appuser:appuser /app
10
- USER appuser
11
-
12
-
13
- ENV HF_HOME=/data/huggingface
14
- # Expose port
15
- EXPOSE 7860
16
-
17
- # Start the server
18
- CMD ["python", "/app/src/server/main.py", "--host", "0.0.0.0", "--port", "7860", "--config", "config_two"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Dockerfile.base CHANGED
@@ -26,7 +26,11 @@ RUN pip install flash-attn --no-build-isolation
26
 
27
  # Copy requirements and configuration files
28
  COPY requirements.txt .
29
- COPY dhwani_config.json .
30
 
31
  # Install Python dependencies
32
  RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
26
 
27
  # Copy requirements and configuration files
28
  COPY requirements.txt .
 
29
 
30
  # Install Python dependencies
31
  RUN pip install --no-cache-dir -r requirements.txt
32
+
33
+ # Set up user
34
+ RUN useradd -ms /bin/bash appuser \
35
+ && chown -R appuser:appuser /app
36
+ USER appuser