Skip to main content

build:dev

The build:dev builds container images for local development.

Run npm run build:dev in the root to trigger this script.

Under the hood, this will run:

Terminal
npm run build:api && \
npm run build:core && \
npm run build:ui && \
npm run build:dbuilder

In other words npm run build:dev is an umbrella script that runs the following run scripts:

Differences between development and production builds

This applies to the containers we build ourselves, not the ones we use as-is from upstream.

Container contents

  • Development builds map the local source code in the container so you can make changes to the code running within without having to enter the container
  • Production builds bundle the source code inside the container

Container entrypoint

  • Development builds running NodeJS (api, core, ui) willrun in development mode where they automatically reload when changes are detected (using nodemon)
  • Production containers use the PM2 process manager to run the NodeJS code

Run script prefix

  • Development builds are triggered with run scripts with the build: prefix
  • Production builds are triggered with run scripts with the ci: prefix (as they are intended to run in )

Container namespace

  • Development builds use the morio namespace (which cannot be published on Dockerhub)
  • Production builds use the itsmorio namespace

Builder

  • Development builds are built using Docker's own BuildKit
  • Production builds are built using Buildah as this avoids the need to access the Docker socket, which is often impossible in a environment.