Giter VIP home page Giter VIP logo

balena-electron's Introduction

Balena Electron Example

This is a very simple, barebones example of how to get an electron app running on balena. It is split out into two parts.

  • One piece is your application (this repo) that installs all dependencies for Electron to be able to run.
    • This example app has an express server, and starts a window in kiosk mode.
  • The second piece is the xserver block, which starts up an X11 server that your application will use to display on.
    • You can see all the environment variables to configure xserver here

balena deploy button

Example docker-compose.yml

version: '2.1'
volumes:
    # we create a shared volume so that the xserver can mount its socket file, and our application container will be able to use it to display
    xserver-volume:
services:
  xserver:
    image: balenablocks/xserver
    restart: always
    privileged: true
    volumes:
      # when we start, a UNIX socket is mounted in this directory, for communication to the X server
      - 'xserver-volume:/tmp/.X11-unix'
  balena-electron:
    build: .
    restart: always
    network_mode: host
    ports:
      - 8080:8080
    volumes:
      # We will have access to the UNIX socket shared by xserver after it has started up.
      - 'xserver-volume:/tmp/.X11-unix'
    environment:
      # We need to specify which display we want to use for the X server. :0 is the first display that we have plugged in. This because there is no default display specified.
      - DISPLAY=:0

Build for multiple architectures

There is an example script in this repo which uses docker buildx to build and push mutliple architecture images, along with the manifest to a docker repo. See build-images.sh for the details.

balena-electron's People

Contributors

nucleardreamer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.