Xeroxa / Dockerfile
Xenobd's picture
Create Dockerfile
93666fc verified
Raw
History Blame Contribute Delete
923 Bytes
# Dockerfile.gpu
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.9 \
python3-pip \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
wget \
&& rm -rf /var/lib/apt/lists/*
# Create symbolic links for python
RUN ln -s /usr/bin/python3.9 /usr/bin/python
# Copy requirements
COPY requirements.txt .
COPY requirements-gpu.txt .
# Install Python dependencies with GPU support
RUN pip install --no-cache-dir -r requirements-gpu.txt
# Download model
RUN wget -O /app/inswapper_128.onnx https://github.com/deepinsight/insightface/releases/download/v0.7/inswapper_128.onnx || \
echo "Please download inswapper_128.onnx manually"
# Copy application
COPY app.py .
# Expose port
EXPOSE 5000
# Run with GPU support
CMD ["python", "app.py"]