#!/bin/bash

# Create VNC password file if it doesn't exist
if [ ! -f /home/myuser/.vncpass ]; then
    x11vnc -storepasswd secret /home/myuser/.vncpass
fi

# Start the services
Xvfb :99 -screen 0 1280x800x24 >/dev/null 2>&1 &
x11vnc -display :99 -forever -rfbauth /home/myuser/.vncpass -listen 0.0.0.0 -rfbport 5900 >/dev/null 2>&1 &
export DISPLAY=:99
startxfce4 >/dev/null 2>&1 &

sleep 2
echo 'Container running!'
tail -f /dev/null
