mirror of
https://github.com/iv-org/youtube-trusted-session-generator.git
synced 2025-01-15 16:12:21 +01:00
dirty patch for retrying more time nodriver + remove some dependencies
This commit is contained in:
parent
c7ea8d6dfb
commit
0551c92227
2 changed files with 9 additions and 21 deletions
10
Dockerfile
10
Dockerfile
|
@ -3,8 +3,6 @@ FROM python:3.12-alpine
|
|||
# Install dependencies
|
||||
RUN apk add --no-cache \
|
||||
xvfb \
|
||||
x11vnc \
|
||||
fluxbox \
|
||||
nss \
|
||||
freetype \
|
||||
freetype-dev \
|
||||
|
@ -14,16 +12,14 @@ RUN apk add --no-cache \
|
|||
chromium \
|
||||
chromium-chromedriver
|
||||
|
||||
# Install x11vnc
|
||||
RUN mkdir ~/.vnc
|
||||
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
|
||||
|
||||
WORKDIR /usr/app/src
|
||||
COPY index.py requirements.txt ./
|
||||
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY docker/scripts/startup.sh ./
|
||||
|
||||
|
||||
RUN sed -i 's/await self.sleep(0.5)/await self.sleep(2)/' /usr/local/lib/python3.12/site-packages/nodriver/core/browser.py
|
||||
|
||||
# Run
|
||||
CMD [ "./startup.sh"]
|
|
@ -2,21 +2,13 @@
|
|||
|
||||
echo "[INFO] internally launching GUI (X11 environment)"
|
||||
|
||||
rm -f /tmp/.X0-lock
|
||||
XVFB_WHD=${XVFB_WHD:-1280x720x16}
|
||||
|
||||
# Run Xvfb on display 0.
|
||||
Xvfb :0 -screen 0 1280x720x16 &>/dev/null &
|
||||
echo "[INFO] starting Xvfb"
|
||||
Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp &
|
||||
sleep 2
|
||||
|
||||
# Run fluxbox windows manager on display 0.
|
||||
fluxbox -display :0 &>/dev/null &
|
||||
|
||||
# Run x11vnc on display 0
|
||||
x11vnc -display :0 -forever -usepw &>/dev/null &
|
||||
|
||||
# Add delay
|
||||
sleep 5
|
||||
|
||||
echo "[INFO] launching the python script"
|
||||
echo "[INFO] launching chromium instance"
|
||||
|
||||
# Run python script on display 0
|
||||
DISPLAY=:0 python index.py
|
||||
DISPLAY=:99 python index.py
|
||||
|
|
Loading…
Reference in a new issue