muddasser commited on
Commit
1b752a3
·
verified ·
1 Parent(s): 02ec903

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -8
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.10-slim
2
 
3
- # Install system dependencies for Chromium and ChromeDriver
4
  RUN apt-get update && apt-get install -y \
5
  chromium \
6
  chromium-driver \
@@ -22,16 +22,19 @@ RUN apt-get update && apt-get install -y \
22
  # Set working directory
23
  WORKDIR /app
24
 
25
- # Create cache directories with proper permissions
26
  RUN mkdir -p /app/cache /tmp/.wdm && chmod -R 777 /app/cache /tmp/.wdm
27
 
28
  # Copy application files
29
  COPY . /app
30
 
 
 
 
31
  # Install Python dependencies
32
  RUN pip install --no-cache-dir -r requirements.txt
33
 
34
- # Set environment variables (update according to installed binaries)
35
  ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
36
  ENV CHROMIUM_PATH=/usr/bin/chromium
37
  ENV DISPLAY=:99
@@ -41,12 +44,8 @@ ENV TRANSFORMERS_CACHE=/app/cache
41
  ENV HF_HOME=/app/cache
42
  ENV WDM_CACHE_DIR=/tmp/.wdm
43
 
44
- # Ensure ChromeDriver and Chromium are executable (only if they exist)
45
- RUN if [ -f /usr/bin/chromedriver ]; then chmod +x /usr/bin/chromedriver; fi && \
46
- if [ -f /usr/bin/chromium ]; then chmod +x /usr/bin/chromium; fi
47
-
48
  # Expose Streamlit port
49
  EXPOSE 8501
50
 
51
  # Run Streamlit
52
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.fileWatcherType=none", "--server.headless=true"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
  chromium \
6
  chromium-driver \
 
22
  # Set working directory
23
  WORKDIR /app
24
 
25
+ # Create cache directories
26
  RUN mkdir -p /app/cache /tmp/.wdm && chmod -R 777 /app/cache /tmp/.wdm
27
 
28
  # Copy application files
29
  COPY . /app
30
 
31
+ # Update pip first
32
+ RUN pip install --upgrade pip
33
+
34
  # Install Python dependencies
35
  RUN pip install --no-cache-dir -r requirements.txt
36
 
37
+ # Set environment variables
38
  ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
39
  ENV CHROMIUM_PATH=/usr/bin/chromium
40
  ENV DISPLAY=:99
 
44
  ENV HF_HOME=/app/cache
45
  ENV WDM_CACHE_DIR=/tmp/.wdm
46
 
 
 
 
 
47
  # Expose Streamlit port
48
  EXPOSE 8501
49
 
50
  # Run Streamlit
51
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.fileWatcherType=none", "--server.headless=true"]