build:api
The build:api
builds a container image for the api service
that can be used for local development.
Run npm run build:api
in the root to trigger this script.
Under the hood, this will run:
Terminal
./scripts/build-container.sh api
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.