fix restart issue

This commit is contained in:
Kilian von Pflugk 2022-08-28 13:53:15 +02:00
parent 90af31a210
commit a468ed5fed
3 changed files with 9 additions and 24 deletions

View file

@ -7,13 +7,12 @@ ARG DEBIAN_FRONTEND=noninteractive
ENV SCREEN_WIDTH 1440 ENV SCREEN_WIDTH 1440
ENV SCREEN_HEIGHT 900 ENV SCREEN_HEIGHT 900
ENV SCREEN_DEPTH 24 ENV SCREEN_DEPTH 24
ENV DISPLAY :60
# Configure VNC via environment variables: # Configure VNC via environment variables:
ENV VNC_ENABLED true
ENV VNC_PASSWORD secret ENV VNC_PASSWORD secret
ENV VNC_PORT 5900 ENV VNC_PORT 5900
ENV NOVNC_PORT 6080 ENV NOVNC_PORT 6080
ENV NOVNC_HOME /usr/share/novnc
EXPOSE 5900 EXPOSE 5900
EXPOSE 6080 EXPOSE 6080
@ -54,8 +53,8 @@ RUN apt-get update \
/usr/share/doc/* \ /usr/share/doc/* \
/var/cache/* \ /var/cache/* \
/var/lib/apt/lists/* \ /var/lib/apt/lists/* \
/var/tmp/* /var/tmp/* \
&& ln -s $NOVNC_HOME/vnc_auto.html $NOVNC_HOME/index.html
WORKDIR /fgc WORKDIR /fgc
COPY package.json . COPY package.json .
@ -70,10 +69,7 @@ COPY . .
# Shell scripts # Shell scripts
RUN dos2unix ./docker/*.sh RUN dos2unix ./docker/*.sh
RUN mv ./docker/entrypoint.sh /usr/local/bin/entrypoint \ RUN mv ./docker/entrypoint.sh /usr/local/bin/entrypoint \
&& chmod +x /usr/local/bin/entrypoint \ && chmod +x /usr/local/bin/entrypoint
&& mv ./docker/vnc-start.sh /usr/local/bin/vnc-start \
&& chmod +x /usr/local/bin/vnc-start
ENTRYPOINT ["entrypoint"] ENTRYPOINT ["entrypoint"]
CMD ["node", "epic-games.js"] CMD ["node", "epic-games.js"]

View file

@ -12,10 +12,10 @@ rm -f /fgc/data/browser/SingletonLock
# Options passed directly to the Xvfb server: # Options passed directly to the Xvfb server:
# -ac disables host-based access control mechanisms # -ac disables host-based access control mechanisms
# screen NUM WxHxD creates the screen and sets its width, height, and depth # screen NUM WxHxD creates the screen and sets its width, height, and depth
Xvfb "$DISPLAY" -ac -screen 0 "${SCREEN_WIDTH}x${SCREEN_HEIGHT}x${SCREEN_DEPTH}" >/dev/null 2>&1 &
if [ "$VNC_ENABLED" = true ]; then
vnc-start >/dev/null 2>&1 &
fi
Xvfb :1 -ac -screen 0 "${SCREEN_WIDTH}x${SCREEN_HEIGHT}x${SCREEN_DEPTH}" >/dev/null 2>&1 &
x11vnc -display :1.0 -forever -shared -rfbport "${VNC_PORT:-5900}" -passwd "${VNC_PASSWORD:-secret}" -bg
websockify -D --web "$NOVNC_HOME" "$NOVNC_PORT" "localhost:$VNC_PORT" &
DISPLAY=:1.0
export DISPLAY
exec tini -g -- "$@" exec tini -g -- "$@"

View file

@ -1,11 +0,0 @@
#!/bin/sh
# Start VNC in a background process:
x11vnc -display "$DISPLAY" -forever -shared -rfbport "${VNC_PORT:-5900}" \
-passwd "${VNC_PASSWORD:-secret}" -bg
NOVNC_HOME=/usr/share/novnc
ln -s $NOVNC_HOME/vnc_auto.html $NOVNC_HOME/index.html
websockify -D --web "$NOVNC_HOME" "$NOVNC_PORT" "localhost:$VNC_PORT" &
# Execute the given command:
exec "$@"