Kevinshh commited on
Commit
087e896
·
verified ·
1 Parent(s): 5594cd9

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim-bookworm
2
+
3
+ # Set environment variables
4
+ ENV PYTHONDONTWRITEBYTECODE=1
5
+ ENV PYTHONUNBUFFERED=1
6
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
7
+ ENV GRADIO_SERVER_PORT="7860"
8
+
9
+ # Install system dependencies for WeasyPrint (PDF generation)
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ libpango-1.0-0 \
12
+ libpangocairo-1.0-0 \
13
+ libcairo2 \
14
+ libgdk-pixbuf-2.0-0 \
15
+ libffi-dev \
16
+ fonts-noto-cjk \
17
+ fonts-noto-cjk-extra \
18
+ && apt-get clean \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ # Set working directory
22
+ WORKDIR /app
23
+
24
+ # Copy requirements and install Python dependencies
25
+ COPY requirements.txt .
26
+ RUN pip install --no-cache-dir --upgrade pip && \
27
+ pip install --no-cache-dir -r requirements.txt
28
+
29
+ # Copy application code
30
+ COPY . .
31
+
32
+ # Expose Gradio port
33
+ EXPOSE 7860
34
+
35
+ # Health check
36
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
37
+ CMD curl -f http://localhost:7860/ || exit 1
38
+
39
+ # Run application
40
+ CMD ["python", "app.py"]