Juna190825 commited on
Commit
39c82d4
·
verified ·
1 Parent(s): 7c14b03

Initial Upload

Browse files
Files changed (1) hide show
  1. Dockerfile +100 -0
Dockerfile ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ FROM python:3.9-slim
3
+
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ wget \
7
+ curl \
8
+ firefox-esr \
9
+ fonts-dejavu \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Create and set working directory
13
+ WORKDIR /app
14
+
15
+ # Create necessary directories with correct permissions
16
+ RUN mkdir -p /tmp/.cache && chmod 777 /tmp/.cache \
17
+ && mkdir -p /tmp/.config && chmod 777 /tmp/.config \
18
+ && mkdir -p /tmp/fontconfig && chmod 777 /tmp/fontconfig \
19
+ && mkdir -p /app/flagged && chmod 777 /app/flagged
20
+
21
+ # Set environment variables
22
+ ENV MPLCONFIGDIR=/tmp/matplotlib
23
+ ENV XDG_CACHE_HOME=/tmp/.cache
24
+ ENV XDG_CONFIG_HOME=/tmp/.config
25
+ ENV FONTCONFIG_PATH=/etc/fonts
26
+ ENV FONTCONFIG_FILE=/etc/fonts/fonts.conf
27
+ ENV FONTCONFIG_CACHE=/tmp/fontconfig
28
+ ENV GRADIO_TEMP_DIR=/tmp/gradio
29
+
30
+ # Copy requirements first
31
+ COPY requirements.txt .
32
+
33
+ # Install Python dependencies with legacy resolver
34
+ RUN pip install --no-cache-dir --use-deprecated=legacy-resolver -r requirements.txt
35
+
36
+ # Download geckodriver
37
+ COPY download_geckodriver.sh .
38
+ RUN chmod +x download_geckodriver.sh && ./download_geckodriver.sh
39
+ RUN chmod +x /app/geckodriver
40
+
41
+ # Copy application
42
+ COPY . .
43
+
44
+ # Set environment variables for Selenium
45
+ ENV DISPLAY=:99
46
+ ENV GECKODRIVER_PATH=/app/geckodriver
47
+ ENV PATH="${PATH}:/app"
48
+
49
+ EXPOSE 7860
50
+
51
+ CMD ["python", "app.py"]
52
+
53
+ # FROM python:3.9-slim
54
+
55
+ # # Install system dependencies
56
+ # RUN apt-get update && apt-get install -y \
57
+ # wget \
58
+ # firefox-esr \
59
+ # fonts-dejavu \
60
+ # && rm -rf /var/lib/apt/lists/*
61
+
62
+ # # Create and set working directory
63
+ # WORKDIR /app
64
+
65
+ # # Create necessary directories with correct permissions
66
+ # RUN mkdir -p /tmp/.cache && chmod 777 /tmp/.cache \
67
+ # && mkdir -p /tmp/.config && chmod 777 /tmp/.config \
68
+ # && mkdir -p /tmp/fontconfig && chmod 777 /tmp/fontconfig \
69
+ # && mkdir -p /app/flagged && chmod 777 /app/flagged
70
+
71
+ # # Set environment variables
72
+ # ENV MPLCONFIGDIR=/tmp/matplotlib
73
+ # ENV XDG_CACHE_HOME=/tmp/.cache
74
+ # ENV XDG_CONFIG_HOME=/tmp/.config
75
+ # ENV FONTCONFIG_PATH=/etc/fonts
76
+ # ENV FONTCONFIG_FILE=/etc/fonts/fonts.conf
77
+ # ENV FONTCONFIG_CACHE=/tmp/fontconfig
78
+ # ENV GRADIO_TEMP_DIR=/tmp/gradio
79
+
80
+ # # Copy requirements first
81
+ # COPY requirements.txt .
82
+
83
+ # # Install Python dependencies with legacy resolver
84
+ # RUN pip install --no-cache-dir --use-deprecated=legacy-resolver -r requirements.txt
85
+
86
+ # # Download geckodriver
87
+ # COPY download_geckodriver.sh .
88
+ # RUN chmod +x download_geckodriver.sh && ./download_geckodriver.sh
89
+
90
+ # # Copy application
91
+ # COPY . .
92
+
93
+ # # Set environment variables for Selenium
94
+ # ENV DISPLAY=:99
95
+ # ENV GECKODRIVER_PATH=/app/geckodriver
96
+ # ENV PATH="${PATH}:/app"
97
+
98
+ # EXPOSE 7860
99
+
100
+ # CMD ["python", "app.py"]