Skip to content

digi-serve/ab_runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub release

The server side runtime for our AppBuilder project.

Installation

Use ab-cli tool.

Starting

Run ./UP.sh to bring up the Docker Stack. Options:

  • -d : dev run develop mode (uses docker-compose.dev.yml)
  • -t : test run in test mode (allows test reset route)
  • -q : quiet run without starting logs

The default account credentials are:

  • email: admin@example.com
  • password: admin

Stop AppBuilder

$ ./Down.sh

View console

$ node logs
// or
$ ./logs.sh [option]

Updating

Rungit pull to update the version file (version.json).
Then run node dockerImageUpdate to update the running services.

Data

Directories used for persistent storage

  • ./mysql/init

    The SQL files contained here will be used to populate the database for the first time.

Much of the config and data are actually saved onto Docker volumes, and are not directly binded to directories anymore. The data backup procedure is left as an exercise for the reader.

Manual Installation

The ab-cli will help set the config and write .env, docker-compose.yml, and docker-compose.override.yml. Examples can be found in /examples/, for a manual install copy these files to the root directory and adjust them as needed.

Config

The most important setting to change is MYSQL_PASSWORD. This will be your DB root password. Choose something secure.

Important note: When the MariaDB container starts up for the first time, it will set the database root password to the value you have specified. After that first time, changing this value will not affect the already established password.

Make sure to add your own settings before running the setup steps below.

Preparation

Follow the Config section on configuring your DB credentials and other settings.

The following steps need to be done with the same docker stack name you plan to run AppBuilder with (referred to here as mystack). This should match the STACKNAME setting in your .env file.

  1. Turn on Docker Swarm if needed

    $ docker swarm init
  2. Copy dbinit-compose.yml from /examples to the project root.

    $ cp ./examples/dbinit-compose.yml ./dbinit-compose.yml
  3. Run dbinit-compose.yml

    $ docker stack deploy -c dbinit-compose.yml mystack
    • Open the logs for mystack_db
      $ docker service logs -f mystack_db
    • Bring down the stack when you see mysqld: ready for connections
      $ docker stack rm mystack
  4. Remove dbinit-compose.yml

    $ rm ./dbinit-compose.yml
  5. Run db migrations

    $ ./migrate.sh

Podman

The runtime can be alternatively used with podman. Most of the scripts already support podman. Make sure the environment variable PLATFORM is set to podman.