namelessai commited on
Commit
b8d5d17
·
verified ·
1 Parent(s): 58e33be

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +44 -0
Dockerfile ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Set environment variables
4
+ ENV PYTHONUNBUFFERED=1 \
5
+ DEBIAN_FRONTEND=noninteractive \
6
+ GRADIO_SERVER_NAME=0.0.0.0 \
7
+ GRADIO_SERVER_PORT=7860
8
+
9
+ # Set working directory
10
+ WORKDIR /app
11
+
12
+ # Install system dependencies including HTTrack
13
+ RUN apt-get update && apt-get install -y --no-install-recommends \
14
+ httrack \
15
+ wget \
16
+ curl \
17
+ ca-certificates \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # Verify HTTrack installation
21
+ RUN httrack --version
22
+
23
+ # Copy requirements file
24
+ COPY requirements.txt .
25
+
26
+ # Install Python dependencies
27
+ RUN pip install --no-cache-dir -r requirements.txt
28
+
29
+ # Copy application code
30
+ COPY app.py .
31
+
32
+ # Create directories for temporary files
33
+ RUN mkdir -p /tmp/httrack_temp && \
34
+ chmod 777 /tmp/httrack_temp
35
+
36
+ # Expose Gradio default port
37
+ EXPOSE 7860
38
+
39
+ # Health check
40
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
41
+ CMD curl -f http://localhost:7860/ || exit 1
42
+
43
+ # Run the application
44
+ CMD ["python", "app.py"]