diff --git a/README.md b/README.md index f381159..a11bc6b 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,15 @@ docker run -it --rm -p 6080:80 -p 5900:5900 -e VNC_PASSWORD=mypassword dorowu/ub A prompt will ask password either in the browser or vnc viewer. +Screen Resolution +------------------ + +Resolution of virtual desktop adapts browser window size when first connecting the server. You may choose a fixed resolution by passing `RESOLUTION` environment variable, for example + +``` +docker run -it --rm -p 6080:80 -e RESOLUTION=1920x1080 dorowu/ubuntu-desktop-lxde-vnc +``` + Troubleshooting and FAQ ================== diff --git a/image/startup.sh b/image/startup.sh index a7f413a..048ee07 100755 --- a/image/startup.sh +++ b/image/startup.sh @@ -14,6 +14,10 @@ if [ -n "$VNC_PASSWORD" ]; then export VNC_PASSWORD= fi -cd /usr/lib/web && ./run.py > /var/log/web.log 2>&1 & +if [ -n "$RESOLUTION" ]; then + sed -i "s/1024x768/$RESOLUTION/" /etc/supervisor/conf.d/supervisord.conf +fi + +cd /usr/lib/web && ./run.py 2>&1 & nginx -c /etc/nginx/nginx.conf exec /bin/tini -- /usr/bin/supervisord -n diff --git a/image/usr/lib/web/lightop/__init__.py b/image/usr/lib/web/lightop/__init__.py index 692887c..68b237a 100644 --- a/image/usr/lib/web/lightop/__init__.py +++ b/image/usr/lib/web/lightop/__init__.py @@ -18,6 +18,8 @@ app = Flask( CONFIG = os.environ.get('CONFIG') or 'config.Development' app.config.from_object('config.Default') app.config.from_object(CONFIG) +FIRST = 'RESOLUTION' not in os.environ + # logging import logging