Skip to content

☁️ Minimal desktop environment running on Heroku

License

Notifications You must be signed in to change notification settings

dreamscached/herokude

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HerokuDE

This project is an attempt to run a (more or less) fully-featured desktop environment in Heroku to be able to run applications in it.

Note however, even though this image was designed to work on Heroku, it also works as standalone Docker image that you can run locally yourself.

How does it work

Since Heroku allows deployment of Docker images, one could create an image with minimal window manager, VNC server software and NoVNC as a way to use VNC in browser (due to Heroku restricting open ports to HTTP/HTTPS only.)

Here, the following components are used:

  • Xvfb for virtual display initialization
  • Fluxbox as window manager
  • X11VNC as VNC server

Things to note

This project is an experiment, Proof-of-Concept only intended to show that the implementation of an idea described above is possible. By using this project you may or may not be violating Heroku Terms of Service, and creators, contributors or maintainers of this repository are not liable for any sort of damage dealt as result of usage of this repository.

Besides, using this image on Free dynos is troublesome due to soft memory limitations that let dyno stay up for a while even with quota exceeded, which may lead to unexpected process kills.

Usage

NOTE: This repository has three different branches with different 'presets' for deployment:

  • master is a completely blank template with just WM installed
  • minimal provides minimal viable desktop environment with browser, file manager, etc.
  • xterm provides ultra-minimal desktop environment with only xterm installed atop of WM

Deploying to Heroku

With Heroku CLI

$ heroku container:push -a <app-name> web
$ heroku container:release -a <app-name> web

With Heroku template

Blank (only WM) Minimal (minimal DE) XTerm (WM + XTerm)
Heroku Deploy button Heroku Deploy button Heroku Deploy button

Running locally

$ git clone https://github.com/dreamscached/herokude HerokuDE
$ docker build --rm -t herokude:ubuntu20.04 .
$ docker run --rm -d --name herokude -e PORT=80 -p 80:80 herokude:ubuntu20.04

Configuration

Image has few environment variables you can use to somehow customize your instance.

Variable Default value Description
GEOMETRY 1920x1080x16 Defines screen geometry in format WIDTHxHEIGHTxDEPTH
PORT 8080 Defines port that NoVNC will listen to
COMMANDLINE bash /data/launch.sh Defines command line to run upon initial setup of window manager and VNC
PASSWORD herokude Defines password used to log in VNC session