FROM python:3.10-bullseye WORKDIR /root RUN apt-get update && apt-get install -y \ sudo \ curl \ unzip \ build-essential \ libvips-dev # Set up pip and python cache directories RUN mkdir -p /root/.local /root/.cache/pip /root/.cache/python RUN chmod -R 777 /root/.local /root/.cache ENV PYTHONUSERBASE=/root ENV PIP_CACHE_DIR=/root/.cache/pip ENV PYTHONPYCACHEPREFIX=/root/.cache/python ENV PATH="/root/bin:$PATH" # Install Node.js 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 # Setup Node.js cache 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 globalconfig /app/home/.npmrc 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 # Fetch project files from GitHub RUN mkdir -p /app /build && \ curl -L -o /tmp/reikerpy.zip https://github.com/ReirLair/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 chmod -R 777 /app EXPOSE 7860 CMD ["python", "server.py"]