Spaces:
Paused
Paused
File size: 1,881 Bytes
2c461f5 | 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 62 | 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 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 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
# 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/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"] |