-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (35 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
46 lines (35 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Use Python 3.9 slim image for smaller size
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install system dependencies for Chrome/Selenium
RUN apt-get update && apt-get install -y \
wget \
gnupg \
unzip \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Chrome
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/chrome.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire application
COPY . .
# Create outputs directory
RUN mkdir -p outputs
# Expose Streamlit port
EXPOSE 8501
# Set environment variables for Streamlit
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_SERVER_ENABLE_CORS=false
ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
# Health check
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
# Run the app
CMD ["streamlit", "run", "web_app/app.py", "--server.address=0.0.0.0", "--server.port=8501"]