| FROM python:3.11-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| wget \ |
| netcat-traditional \ |
| gnupg \ |
| curl \ |
| unzip \ |
| zip \ |
| xvfb \ |
| libgconf-2-4 \ |
| libxss1 \ |
| libnss3 \ |
| libnspr4 \ |
| libasound2 \ |
| libatk1.0-0 \ |
| libatk-bridge2.0-0 \ |
| libcups2 \ |
| libdbus-1-3 \ |
| libdrm2 \ |
| libgbm1 \ |
| libgtk-3-0 \ |
| libxcomposite1 \ |
| libxdamage1 \ |
| libxfixes3 \ |
| libxrandr2 \ |
| xdg-utils \ |
| fonts-liberation \ |
| dbus \ |
| xauth \ |
| xvfb \ |
| x11vnc \ |
| tigervnc-tools \ |
| supervisor \ |
| net-tools \ |
| procps \ |
| git \ |
| python3-numpy \ |
| fontconfig \ |
| fonts-dejavu \ |
| fonts-dejavu-core \ |
| fonts-dejavu-extra \ |
| tmux \ |
| |
| poppler-utils \ |
| wkhtmltopdf \ |
| |
| antiword \ |
| unrtf \ |
| catdoc \ |
| |
| grep \ |
| gawk \ |
| sed \ |
| |
| file \ |
| |
| jq \ |
| csvkit \ |
| xmlstarlet \ |
| |
| less \ |
| vim \ |
| tree \ |
| rsync \ |
| lsof \ |
| iputils-ping \ |
| dnsutils \ |
| sudo \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ |
| && apt-get install -y nodejs \ |
| && npm install -g npm@latest |
| |
| |
| RUN npm install -g wrangler |
| |
| |
| RUN git clone https://github.com/novnc/noVNC.git /opt/novnc \ |
| && git clone https://github.com/novnc/websockify /opt/novnc/utils/websockify \ |
| && ln -s /opt/novnc/vnc.html /opt/novnc/index.html |
| |
| |
| ARG TARGETPLATFORM=linux/amd64 |
| |
| |
| WORKDIR /app |
| |
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
| |
| |
| COPY . /app |
| COPY server.py /app/server.py |
| COPY browser_api.py /app/browser_api.py |
| |
| |
| ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright |
| |
| RUN pip install playwright |
| |
| RUN playwright install-deps |
| RUN playwright install chromium |
| |
| RUN python -c "from playwright.sync_api import sync_playwright; print('Playwright installation verified')" |
| |
| |
| ENV PYTHONUNBUFFERED=1 |
| ENV CHROME_PATH=/ms-playwright/chromium-*/chrome-linux/chrome |
| ENV ANONYMIZED_TELEMETRY=false |
| ENV DISPLAY=:99 |
| ENV RESOLUTION=1920x1080x24 |
| ENV VNC_PASSWORD=vncpassword |
| ENV CHROME_PERSISTENT_SESSION=true |
| ENV RESOLUTION_WIDTH=1920 |
| ENV RESOLUTION_HEIGHT=1080 |
| |
| |
| RUN mkdir -p /var/log/supervisor |
| COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf |
| |
| EXPOSE 7788 6080 5901 8000 8080 |
| |
| CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] |
| |