| |
| FROM python:3.10-slim |
|
|
| |
| ENV PYTHONDONTWRITEBYTECODE=1 \ |
| PYTHONUNBUFFERED=1 \ |
| HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
|
|
| |
| RUN useradd -m -u 1000 user |
|
|
| |
| WORKDIR $HOME/app |
|
|
| |
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| wget \ |
| curl \ |
| unzip \ |
| gnupg \ |
| ca-certificates \ |
| |
| libx11-6 \ |
| libx11-xcb1 \ |
| libxcomposite1 \ |
| libxcursor1 \ |
| libxdamage1 \ |
| libxext6 \ |
| libxfixes3 \ |
| libxi6 \ |
| libxrandr2 \ |
| libxrender1 \ |
| libxss1 \ |
| libxtst6 \ |
| libglib2.0-0 \ |
| libnss3 \ |
| libnspr4 \ |
| libasound2 \ |
| libatk1.0-0 \ |
| libatk-bridge2.0-0 \ |
| libcups2 \ |
| libdbus-1-3 \ |
| libdrm2 \ |
| libgbm1 \ |
| libpango-1.0-0 \ |
| libpangocairo-1.0-0 \ |
| fonts-liberation \ |
| xdg-utils \ |
| libxkbcommon0 \ |
| |
| libgl1 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ |
| && apt-get install -y nodejs \ |
| && rm -rf /var/lib/apt/lists/* |
| |
| |
| |
| RUN wget -q https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.52/linux64/chrome-linux64.zip \ |
| && unzip -q chrome-linux64.zip \ |
| && mv chrome-linux64 /opt/chrome \ |
| && ln -s /opt/chrome/chrome /usr/local/bin/google-chrome \ |
| && rm chrome-linux64.zip |
|
|
| |
| |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir \ |
| numpy>=1.20 \ |
| opencv-python-headless>=4.5 \ |
| selenium>=4 \ |
| webdriver-manager>=4 \ |
| scikit-image \ |
| gradio |
|
|
| |
| COPY --chown=user . $HOME/app |
|
|
| |
| |
| RUN mkdir -p driver \ |
| && wget -q https://storage.googleapis.com/chrome-for-testing-public/135.0.7049.114/linux64/chromedriver-linux64.zip \ |
| && unzip -q chromedriver-linux64.zip \ |
| && mv chromedriver-linux64/chromedriver driver/ \ |
| && chmod +x driver/chromedriver \ |
| && rm -r chromedriver-linux64 chromedriver-linux64.zip \ |
| && chown -R user:user driver |
| |
| |
| RUN pip install --no-cache-dir . |
| |
| |
| USER user |
| |
| |
| EXPOSE 7860 |
| |
| |
| CMD ["python3", "scripts/app.py"] |
| |