Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +38 -0
Dockerfile
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
+
|
3 |
+
WORKDIR /app
|
4 |
+
|
5 |
+
# Install system dependencies
|
6 |
+
RUN apt-get update && apt-get install -y \
|
7 |
+
build-essential \
|
8 |
+
ffmpeg \
|
9 |
+
libsm6 \
|
10 |
+
libxext6 \
|
11 |
+
&& rm -rf /var/lib/apt/lists/*
|
12 |
+
|
13 |
+
# Copy requirements first for better caching
|
14 |
+
COPY requirements.txt .
|
15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
+
|
17 |
+
# Copy app code
|
18 |
+
COPY . .
|
19 |
+
|
20 |
+
# Create necessary directories
|
21 |
+
RUN mkdir -p static templates models
|
22 |
+
|
23 |
+
# Create static/index.html if it doesn't exist
|
24 |
+
RUN if [ ! -f static/index.html ]; then \
|
25 |
+
mkdir -p static && \
|
26 |
+
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; \
|
27 |
+
fi
|
28 |
+
|
29 |
+
# Set environment variables
|
30 |
+
ENV PYTHONUNBUFFERED=1
|
31 |
+
ENV PORT=7860
|
32 |
+
ENV HOST=0.0.0.0
|
33 |
+
|
34 |
+
# Expose the port
|
35 |
+
EXPOSE 7860
|
36 |
+
|
37 |
+
# Run the application
|
38 |
+
CMD ["python", "app.py"]
|