Update Dockerfile
Browse files- Dockerfile +91 -9
Dockerfile
CHANGED
|
@@ -1,19 +1,101 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
WORKDIR /
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
RUN
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
RUN rm -
|
| 8 |
|
| 9 |
-
RUN
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
RUN
|
|
|
|
|
|
|
| 14 |
|
| 15 |
-
RUN
|
| 16 |
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
-
CMD ["
|
|
|
|
| 1 |
+
FROM python:3.10-bullseye
|
| 2 |
|
| 3 |
+
WORKDIR /root
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
sudo \
|
| 7 |
+
curl \
|
| 8 |
+
unzip \
|
| 9 |
+
build-essential \
|
| 10 |
+
libvips-dev
|
| 11 |
+
|
| 12 |
+
RUN mkdir -p /root/.local /root/.cache/pip
|
| 13 |
+
RUN chmod -R 777 /root
|
| 14 |
+
|
| 15 |
+
ENV PATH="/root/bin:$PATH"
|
| 16 |
+
ENV PYTHONUSERBASE=/root
|
| 17 |
+
ENV PIP_CACHE_DIR=/root/.cache/pip
|
| 18 |
+
RUN apt-get update && apt-get install -y \
|
| 19 |
+
wget \
|
| 20 |
+
curl \
|
| 21 |
+
unzip \
|
| 22 |
+
fonts-liberation \
|
| 23 |
+
libasound2 \
|
| 24 |
+
libatk-bridge2.0-0 \
|
| 25 |
+
libatk1.0-0 \
|
| 26 |
+
libcups2 \
|
| 27 |
+
libdbus-1-3 \
|
| 28 |
+
libgbm-dev \
|
| 29 |
+
libnspr4 \
|
| 30 |
+
libnss3 \
|
| 31 |
+
libxcomposite1 \
|
| 32 |
+
libxdamage1 \
|
| 33 |
+
libxfixes3 \
|
| 34 |
+
libxrandr2 \
|
| 35 |
+
xdg-utils \
|
| 36 |
+
libu2f-udev \
|
| 37 |
+
libvulkan1 \
|
| 38 |
+
xvfb \
|
| 39 |
+
ca-certificates \
|
| 40 |
+
git \
|
| 41 |
+
--no-install-recommends && \
|
| 42 |
+
rm -rf /var/lib/apt/lists/*
|
| 43 |
+
|
| 44 |
+
RUN apt-get update && apt-get install -y \
|
| 45 |
+
coreutils \
|
| 46 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 47 |
+
|
| 48 |
+
RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /usr/share/keyrings/google-chrome-keyring.gpg \
|
| 49 |
+
&& 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 \
|
| 50 |
+
&& apt-get update \
|
| 51 |
+
&& apt-get install -y google-chrome-stable
|
| 52 |
+
|
| 53 |
+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome \
|
| 54 |
+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
| 55 |
+
PUPPETEER_CACHE_DIR=/tmp/puppeteer_cache \
|
| 56 |
+
NODE_ENV=production
|
| 57 |
|
| 58 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
| 59 |
+
RUN apt-get install -y nodejs
|
| 60 |
+
RUN npm install -g npm@latest
|
| 61 |
|
| 62 |
+
RUN rm -f /root/.npmrc
|
| 63 |
|
| 64 |
+
RUN mkdir -p /app/home/.npm-global /app/home/.npm /app/home/.npm/.cache
|
| 65 |
+
RUN chmod -R 777 /app/home/.npm-global /app/home/.npm /app/home/.npm/.cache
|
| 66 |
+
RUN chown -R root:root /app/home/.npm-global /app/home/.npm /app/home/.npm/.cache
|
| 67 |
|
| 68 |
+
RUN mkdir -p /.npm /.npm/.cache ./npm ./npm/.cache
|
| 69 |
+
RUN chmod -R 777 /.npm /.npm/.cache ./npm ./npm/.cache
|
| 70 |
+
RUN chown -R root:root /.npm /.npm/.cache ./npm ./npm/.cache
|
| 71 |
+
|
| 72 |
+
RUN npm config set cache /app/home/.npm/.cache
|
| 73 |
+
RUN npm config set prefix /app/home/.npm-global
|
| 74 |
+
RUN npm config set userconfig /app/home/.npmrc
|
| 75 |
+
|
| 76 |
+
ENV NPM_CONFIG_PREFIX="/app/home/.npm-global"
|
| 77 |
+
ENV NPM_CONFIG_CACHE="/app/home/.npm/.cache"
|
| 78 |
+
|
| 79 |
+
RUN mkdir -p /app/node_modules /app/home/node_modules
|
| 80 |
+
RUN chmod -R 777 /app/node_modules /app/home/node_modules
|
| 81 |
+
RUN chown -R root:root /app/node_modules /app/home/node_modules
|
| 82 |
+
|
| 83 |
+
# Download and unzip the GitHub repo instead of using git clone
|
| 84 |
+
# Use a clean /build path to extract and copy contents
|
| 85 |
+
RUN mkdir -p /app /build && \
|
| 86 |
+
curl -L -o /tmp/reikerpy.zip https://github.com/reaperofssa/reikerpy/archive/refs/heads/main.zip && \
|
| 87 |
+
unzip /tmp/reikerpy.zip -d /build && \
|
| 88 |
+
cp -r /build/reikerpy-main/* /app/ && \
|
| 89 |
+
rm -rf /tmp/reikerpy.zip /build
|
| 90 |
+
|
| 91 |
+
WORKDIR /app
|
| 92 |
|
| 93 |
+
RUN pip install --upgrade pip
|
| 94 |
+
RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
|
| 95 |
+
RUN npx puppeteer install
|
| 96 |
|
| 97 |
+
RUN chmod -R 777 /app
|
| 98 |
|
| 99 |
EXPOSE 7860
|
| 100 |
|
| 101 |
+
CMD ["python", "server.py"]
|