Spaces:
Paused
Paused
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"] |