File size: 1,513 Bytes
9d74f3e 001c0e8 991201b 9bb79e1 991201b 03ce648 9d74f3e 351dc2f cc04d1e 03ce648 9d74f3e 03ce648 991201b 67aa99d 991201b a45edff 38d86de a45edff 991201b e5e420f ae245a5 991201b e5e420f a45edff 991201b 1b752a3 991201b 45d6012 7222f5f 991201b e5e420f 9d74f3e 1b752a3 9d74f3e aab6560 67aa99d 001c0e8 a26913a 991201b 351dc2f | 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | FROM python:3.10-slim
# Install system dependencies for Playwright
RUN apt-get update && apt-get install -y \
curl \
net-tools \
wget \
unzip \
libglib2.0-0 \
libnss3 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
libgbm1 \
libasound2 \
libcups2 \
libxfixes3 \
libpango-1.0-0 \
libcairo2 \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Create cache directory
RUN mkdir -p /app/cache/pip && \
chmod -R 777 /app/cache
# Set pip cache directory
ENV XDG_CACHE_HOME=/app/cache/pip
ENV PIP_NO_CACHE_DIR=1
# Copy requirements
COPY requirements.txt .
# Install dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt && \
pip install tokenizers==0.19.1 && \
playwright install
# Verify transformers
RUN python -c "import transformers; from transformers import pipeline; print('Transformers pipeline imported successfully, version:', transformers.__version__)" && \
python -c "import tokenizers; print('Tokenizers imported successfully, version:', tokenizers.__version__)"
# Copy application
COPY . .
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV STREAMLIT_OPT_OUT_OF_USAGE_STATISTICS=true
ENV HF_HOME=/app/cache
# Expose Streamlit port
EXPOSE 8501
# Run Streamlit
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.fileWatcherType=none", "--server.headless=true"] |