sachin
test
0699851
raw
history blame
1.39 kB
FROM nvidia/cuda:12.8.0-cudnn-devel-ubuntu22.04
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip python3-distutils python3-dev python3-venv \
git \
ffmpeg \
sudo wget curl software-properties-common build-essential gcc g++ \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Set compiler environment variables
ENV CC=/usr/bin/gcc
ENV CXX=/usr/bin/g++
# Upgrade pip and install base Python dependencies
RUN pip install --upgrade pip setuptools setuptools-rust torch
RUN pip install flash-attn --no-build-isolation
# Copy requirements and configuration files
COPY requirements.txt .
COPY dhwani_config.json .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Create a directory for pre-downloaded models
RUN mkdir -p /app/models
# Copy and run the model download script
COPY download_models.py .
RUN python download_models.py
# Copy application code
COPY . .
# Set up user
RUN useradd -ms /bin/bash appuser \
&& chown -R appuser:appuser /app
USER appuser
# Expose port
EXPOSE 7860
# Start the server
CMD ["python", "/app/src/server/main.py", "--host", "0.0.0.0", "--port", "7860", "--config", "config_two"]