File size: 1,905 Bytes
54c5666
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# ULTRATHINK - Multi-stage Dockerfile
# Supports both CPU and GPU training/inference

# ============================================
# Stage 1: Base image with dependencies
# ============================================
FROM python:3.10-slim AS base

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    DEBIAN_FRONTEND=noninteractive

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \

    git \
    build-essential \
    ffmpeg \
    libsndfile1 \
    curl \
    ca-certificates \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install Python dependencies
COPY requirements.txt ./
RUN pip install --upgrade pip setuptools wheel && \

    pip install -r requirements.txt

# ============================================
# Stage 2: Development image
# ============================================
FROM base AS development

# Install development tools
RUN pip install \

    pytest \
    pytest-cov \
    black \
    flake8 \
    mypy \
    ipython \
    jupyter

COPY . .

# ============================================
# Stage 3: Production image (minimal)
# ============================================
FROM base AS production

# Copy only necessary files
COPY src/ ./src/
COPY train_ultrathink.py train_advanced.py app_gradio.py ./
COPY configs/ ./configs/
COPY scripts/ ./scripts/

# Create directories for outputs
RUN mkdir -p /app/outputs /app/checkpoints

# Expose ports
EXPOSE 7860 8000 5000

# Default command: run Gradio app
CMD ["python", "app_gradio.py"]

# ============================================
# Stage 4: Training image
# ============================================
FROM production AS training

# Copy test data and utilities
COPY tests/ ./tests/

# Default command: show help
CMD ["python", "train_ultrathink.py", "--help"]