# DreamTail - SDXL Image Generation Service for NVIDIA Jetson AGX Orin # Based on NVIDIA L4T PyTorch container optimized for Jetson FROM dustynv/pytorch:2.1-r36.2.0 # Set working directory WORKDIR /app # Install system dependencies # libgl1-mesa-glx, libglib2.0-0: OpenCV # libsm6, libxext6, libxrender-dev: Additional OpenCV/InsightFace deps RUN apt-get update && apt-get install -y \ git \ wget \ curl \ libgl1-mesa-glx \ libglib2.0-0 \ libsm6 \ libxext6 \ libxrender-dev \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt /app/ # Install Python dependencies # Note: torch and torchvision are already in the base image RUN pip3 install --no-cache-dir -r requirements.txt # Install onnxruntime for Jetson (from NVIDIA's pre-built wheels) # The base dustynv image should have it, but ensure it's available RUN pip3 install --no-cache-dir onnxruntime || echo "onnxruntime already installed or using system version" # Copy application code COPY config.py /app/ COPY main.py /app/ COPY api/ /app/api/ COPY worker/ /app/worker/ COPY dreamtail_storage/ /app/dreamtail_storage/ # Create storage directories RUN mkdir -p /app/storage/images /app/storage/faces /app/models/ip-adapter # Expose API port EXPOSE 8765 # Set environment variables ENV PYTHONUNBUFFERED=1 ENV DREAMTAIL_STORAGE=/app/storage ENV DREAMTAIL_MODELS=/app/models # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ CMD curl -f http://localhost:8765/health || exit 1 # Run the FastAPI application CMD ["python3", "main.py"]