[supervisord]
nodaemon=true
user=root
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[program:xvfb]
command=Xvfb :99 -screen 0 1280x1024x24 -ac +extension GLX +render -noreset
user=vncuser
autostart=true
autorestart=true
priority=100
stdout_logfile=/var/log/supervisor/xvfb.log
stderr_logfile=/var/log/supervisor/xvfb.log

[program:xfce4]
command=startxfce4
user=vncuser
environment=DISPLAY=":99"
autostart=true
autorestart=true
priority=200
stdout_logfile=/var/log/supervisor/xfce4.log
stderr_logfile=/var/log/supervisor/xfce4.log

[program:vnc]
command=x11vnc -display :99 -forever -usepw -create -rfbport 5901 -nopw -shared
user=vncuser
environment=DISPLAY=":99"
autostart=true
autorestart=true
priority=300
stdout_logfile=/var/log/supervisor/vnc.log
stderr_logfile=/var/log/supervisor/vnc.log

[program:novnc]
command=websockify --web=/usr/share/novnc/ 6080 localhost:5901
user=vncuser
autostart=true
autorestart=true
priority=400
stdout_logfile=/var/log/supervisor/novnc.log
stderr_logfile=/var/log/supervisor/novnc.log

[program:desktop-app]
command=/app/desktop-app/client/bin/client
user=vncuser
environment=DISPLAY=":99",API_BASE_URL="http://api-gateway:8081"
directory=/app/desktop-app
autostart=true
autorestart=false
priority=500
stdout_logfile=/var/log/supervisor/desktop-app.log
stderr_logfile=/var/log/supervisor/desktop-app.log
