Create Dockerfile
Browse files- Dockerfile +30 -0
Dockerfile
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use lightweight Python image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Install system dependencies (fonts + essentials)
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
fonts-dejavu \
|
7 |
+
fonts-freefont-ttf \
|
8 |
+
wget \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
+
|
11 |
+
# Set working directory
|
12 |
+
WORKDIR /app
|
13 |
+
|
14 |
+
# Install Python dependencies first (for layer caching)
|
15 |
+
COPY requirements.txt .
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Copy application files
|
19 |
+
COPY app.py .
|
20 |
+
|
21 |
+
# Download a nice font (optional)
|
22 |
+
RUN wget https://github.com/googlefonts/roboto/raw/main/src/hinted/Roboto-Black.ttf -O /usr/share/fonts/truetype/Roboto-Bold.ttf \
|
23 |
+
&& fc-cache -f -v
|
24 |
+
|
25 |
+
# Set environment variables
|
26 |
+
ENV GRADIO_SERVER_NAME=0.0.0.0
|
27 |
+
ENV GRADIO_SERVER_PORT=7860
|
28 |
+
|
29 |
+
# Run the application
|
30 |
+
CMD ["python", "app.py"]
|