FROM python:3.9 # Create non-root user RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" # Set working directory WORKDIR /app # Clone the FastSD CPU repository RUN git clone https://github.com/rupeshs/fastsdcpu.git . # Install Python dependencies from cloned repo's requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Create results directory with proper permissions RUN mkdir -p /app/results && chmod -R 775 /app/results # Expose port for FastAPI server EXPOSE 8000 # Command to run the FastAPI server CMD ["python", "src/app.py", "--api"]