Update Dockerfile
Browse files- Dockerfile +9 -5
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
FROM alpine:edge
|
| 2 |
|
| 3 |
-
# 1. Install desktop, VNC, and
|
| 4 |
RUN apk update && apk add --no-cache \
|
| 5 |
bash \
|
| 6 |
xfce4 \
|
|
@@ -17,11 +17,11 @@ RUN apk update && apk add --no-cache \
|
|
| 17 |
ttf-dejavu \
|
| 18 |
xrdb
|
| 19 |
|
| 20 |
-
# 2. Fix permissions for
|
| 21 |
RUN mkdir -p /tmp/.X11-unix /tmp/.ICE-unix && \
|
| 22 |
chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix
|
| 23 |
|
| 24 |
-
# 3. Delete the XFCE power manager autostart
|
| 25 |
RUN rm -f /etc/xdg/autostart/xfce4-power-manager.desktop
|
| 26 |
|
| 27 |
# 4. Create a non-root user
|
|
@@ -29,9 +29,13 @@ RUN adduser -D -u 1000 user
|
|
| 29 |
ENV HOME=/home/user
|
| 30 |
ENV PATH=/home/user/.local/bin:$PATH
|
| 31 |
|
| 32 |
-
# 5. Bulletproof Health Check Fix
|
|
|
|
| 33 |
RUN echo '<meta http-equiv="refresh" content="0; url=vnc.html">' > /usr/share/novnc/index.html
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
WORKDIR $HOME
|
| 36 |
|
| 37 |
# 6. Set VNC password and fix permissions
|
|
@@ -45,7 +49,7 @@ USER user
|
|
| 45 |
# 8. Expose web port
|
| 46 |
EXPOSE 7860
|
| 47 |
|
| 48 |
-
# 9. Start everything
|
| 49 |
CMD bash -c "\
|
| 50 |
Xvfb :0 -screen 0 1024x768x24 & \
|
| 51 |
sleep 2 ; \
|
|
|
|
| 1 |
FROM alpine:edge
|
| 2 |
|
| 3 |
+
# 1. Install desktop, VNC, and utilities
|
| 4 |
RUN apk update && apk add --no-cache \
|
| 5 |
bash \
|
| 6 |
xfce4 \
|
|
|
|
| 17 |
ttf-dejavu \
|
| 18 |
xrdb
|
| 19 |
|
| 20 |
+
# 2. Fix permissions for X11/ICE sockets
|
| 21 |
RUN mkdir -p /tmp/.X11-unix /tmp/.ICE-unix && \
|
| 22 |
chmod 1777 /tmp/.X11-unix /tmp/.ICE-unix
|
| 23 |
|
| 24 |
+
# 3. Delete the XFCE power manager autostart
|
| 25 |
RUN rm -f /etc/xdg/autostart/xfce4-power-manager.desktop
|
| 26 |
|
| 27 |
# 4. Create a non-root user
|
|
|
|
| 29 |
ENV HOME=/home/user
|
| 30 |
ENV PATH=/home/user/.local/bin:$PATH
|
| 31 |
|
| 32 |
+
# 5. Bulletproof Health Check & Heartbeat Fix
|
| 33 |
+
# Create the index.html redirect for HF health checks
|
| 34 |
RUN echo '<meta http-equiv="refresh" content="0; url=vnc.html">' > /usr/share/novnc/index.html
|
| 35 |
|
| 36 |
+
# Inject the JavaScript heartbeat into the VNC page so HF doesn't pause while in use
|
| 37 |
+
RUN sed -i '/<\/head>/i \ <script>\n setInterval(function() {\n fetch("/");\n }, 60000);\n </script>' /usr/share/novnc/vnc.html
|
| 38 |
+
|
| 39 |
WORKDIR $HOME
|
| 40 |
|
| 41 |
# 6. Set VNC password and fix permissions
|
|
|
|
| 49 |
# 8. Expose web port
|
| 50 |
EXPOSE 7860
|
| 51 |
|
| 52 |
+
# 9. Start everything
|
| 53 |
CMD bash -c "\
|
| 54 |
Xvfb :0 -screen 0 1024x768x24 & \
|
| 55 |
sleep 2 ; \
|