54 lines
1.3 KiB
Docker
Executable File
54 lines
1.3 KiB
Docker
Executable File
# 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
|
|
|
|
# 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"]
|