File size: 1,013 Bytes
588b9b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98f2d6e
588b9b6
 
 
 
 
 
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
FROM python:3.9-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    ffmpeg \
    libsm6 \
    libxext6 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy app code
COPY . .

# Create necessary directories
RUN mkdir -p static templates models

# Create static/index.html if it doesn't exist
RUN if [ ! -f static/index.html ]; then \
    mkdir -p static && \
    echo '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>AGI Telecom POC</title></head><body><h1>AGI Telecom POC</h1><p>Please use the Gradio interface at <a href="/gradio">/gradio</a> or access the API directly.</p></body></html>' > static/index.html; \
    fi

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PORT=7860
ENV HOST=0.0.0.0
ENV MPLCONFIGDIR=/tmp/matplotlib

# Expose the port
EXPOSE 7860

# Run the application
CMD ["python", "app.py"]