Spaces:
Paused
Paused
| FROM python:3.10-bullseye | |
| WORKDIR /root | |
| RUN apt-get update && apt-get install -y \ | |
| sudo \ | |
| curl \ | |
| unzip \ | |
| build-essential \ | |
| libvips-dev | |
| RUN mkdir -p /root/.local /root/.cache/pip | |
| RUN chmod -R 777 /root | |
| ENV PATH="/root/bin:$PATH" | |
| ENV PYTHONUSERBASE=/root | |
| ENV PIP_CACHE_DIR=/root/.cache/pip | |
| RUN apt-get update && apt-get install -y \ | |
| wget \ | |
| curl \ | |
| unzip \ | |
| fonts-liberation \ | |
| libasound2 \ | |
| libatk-bridge2.0-0 \ | |
| libatk1.0-0 \ | |
| libcups2 \ | |
| libdbus-1-3 \ | |
| libgbm-dev \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| xdg-utils \ | |
| libu2f-udev \ | |
| libvulkan1 \ | |
| xvfb \ | |
| ca-certificates \ | |
| git \ | |
| --no-install-recommends && \ | |
| rm -rf /var/lib/apt/lists/* | |
| RUN apt-get update && apt-get install -y \ | |
| coreutils \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /usr/share/keyrings/google-chrome-keyring.gpg \ | |
| && echo 'deb [signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list \ | |
| && apt-get update \ | |
| && apt-get install -y google-chrome-stable | |
| ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome \ | |
| PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \ | |
| PUPPETEER_CACHE_DIR=/tmp/puppeteer_cache \ | |
| NODE_ENV=production | |
| RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - | |
| RUN apt-get install -y nodejs | |
| RUN npm install -g npm@latest | |
| RUN rm -f /root/.npmrc | |
| RUN mkdir -p /app/home/.npm-global /app/home/.npm /app/home/.npm/.cache | |
| RUN chmod -R 777 /app/home/.npm-global /app/home/.npm /app/home/.npm/.cache | |
| RUN chown -R root:root /app/home/.npm-global /app/home/.npm /app/home/.npm/.cache | |
| RUN mkdir -p /.npm /.npm/.cache ./npm ./npm/.cache | |
| RUN chmod -R 777 /.npm /.npm/.cache ./npm ./npm/.cache | |
| RUN chown -R root:root /.npm /.npm/.cache ./npm ./npm/.cache | |
| RUN npm config set cache /app/home/.npm/.cache | |
| RUN npm config set prefix /app/home/.npm-global | |
| RUN npm config set userconfig /app/home/.npmrc | |
| ENV NPM_CONFIG_PREFIX="/app/home/.npm-global" | |
| ENV NPM_CONFIG_CACHE="/app/home/.npm/.cache" | |
| RUN mkdir -p /app/node_modules /app/home/node_modules | |
| RUN chmod -R 777 /app/node_modules /app/home/node_modules | |
| RUN chown -R root:root /app/node_modules /app/home/node_modules | |
| # Download and unzip the GitHub repo instead of using git clone | |
| # Use a clean /build path to extract and copy contents | |
| RUN mkdir -p /app /build && \ | |
| curl -L -o /tmp/reikerpy.zip https://github.com/reaperofssa/reikerpy/archive/refs/heads/main.zip && \ | |
| unzip /tmp/reikerpy.zip -d /build && \ | |
| cp -r /build/reikerpy-main/* /app/ && \ | |
| rm -rf /tmp/reikerpy.zip /build | |
| WORKDIR /app | |
| RUN pip install --upgrade pip | |
| RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt | |
| RUN npx puppeteer install | |
| RUN chmod -R 777 /app | |
| EXPOSE 7860 | |
| CMD ["python", "server.py"] |