FROM pytorch/pytorch:2.1.0-cuda11.8-cudnn8-devel WORKDIR /app ENV DEBIAN_FRONTEND=noninteractive # Install system dependencies for both apps # Includes OpenCV deps, Font rendering, and build tools RUN apt-get update && apt-get install -y \ wget \ fontconfig \ libfontconfig1 \ libgl1 \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender1 \ libasound2 \ fonts-dejavu-core \ fonts-liberation \ fonts-noto-core \ fonts-noto-extra \ fonts-noto-color-emoji \ libraqm0 \ libfreetype6 \ libfribidi0 \ libharfbuzz0b \ libprotobuf-dev \ protobuf-compiler \ git \ && rm -rf /var/lib/apt/lists/* # Copy root requirements and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all application code COPY . . # Download high-quality fonts for id-maker to bypass Git LFS issues RUN mkdir -p id-maker/assets && \ wget -O id-maker/assets/tahomabd.ttf "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/tahomabd.ttf" && \ wget -O id-maker/assets/TYBAH.TTF "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/TYBAH.TTF" && \ wget -O id-maker/assets/arialbd.ttf "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/arialbd.ttf" # Set up storage directories and permissions WORKDIR /app RUN mkdir -p id-maker/storage/uploads id-maker/storage/processed id-maker/storage/results && \ chmod -R 777 /app # Create the startup script to run both services COPY start.sh . RUN chmod +x start.sh # Configure Hugging Face user RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH EXPOSE 7860 # Start both services CMD ["./start.sh"]