Samizie commited on
Commit
8a2bf6c
·
verified ·
1 Parent(s): 264e828

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -30
Dockerfile CHANGED
@@ -1,38 +1,19 @@
1
- # Use a lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # Set environment variables
5
- ENV PYTHONDONTWRITEBYTECODE=1
6
- ENV PYTHONUNBUFFERED=1
7
-
8
- # Set working directory
9
- WORKDIR /app
10
-
11
- # Install system dependencies for Playwright
12
- RUN apt-get update && apt-get install -y \
13
- curl \
14
- wget \
15
- unzip \
16
- libnss3 \
17
- libxss1 \
18
- libasound2 \
19
- fonts-liberation \
20
- libgbm-dev \
21
- && rm -rf /var/lib/apt/lists/*
22
 
23
  # Install Python dependencies
24
- COPY requirements.txt /app/
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
- # Install Playwright and browser dependencies
28
- RUN playwright install
29
- RUN playwright install --with-deps chromium
30
 
31
- # Copy the project files
32
- COPY . /app/
33
-
34
- # Expose the default Streamlit port
35
- EXPOSE 7860
36
 
37
- # Command to run the Streamlit app
38
- CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Install dependencies
4
+ RUN apt-get update && apt-get install -y wget curl libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon0 libxcomposite1 libxrandr2 libasound2 libpangocairo-1.0-0 libxdamage1 libgbm1 libpango-1.0-0 libgtk-3-0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
  # Install Python dependencies
7
+ COPY requirements.txt .
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
+ # Install Playwright and Browsers
11
+ RUN pip install playwright
12
+ RUN playwright install chromium
13
 
14
+ # Copy app files
15
+ COPY . /app
16
+ WORKDIR /app
 
 
17
 
18
+ # Run the app
19
+ CMD ["streamlit", "run", "app.py"]