Skip to content

Jaevii/DSM-dev

Repository files navigation

WARNING: Documentation may be outdated from parent repo

Builds a container containing Digiprime and Negotiation Engine.

It also starts a MongoDB server that both applications use. Authentication is handled by Keycloak which is started as well.

An automated build of the container exists on Docker Hub. To use this replace digiprime with norlen/digiprime:latest in the commands below.

Build

Get the source, the submodules must be cloned as well for the build to be valid.

git clone --recurse-submodules https://github.com/LarsHajdronKolajder/digiprime-container
cd digiprime-container
docker build . -t digiprime     # Build container

Development build

Instructions to start a development build exist here, currently production builds are not supported. To use the pre-built image replace digiprime with norlen/digiprime:latest. If the image has been pulled before run docker image rm norlen/digiprime:latest to clear it.

The most basic way to run is

docker run -p 3000:3000 \
  --env MAPBOX_TOKEN=<your token> \
  digiprime

Runs Digiprime which is avaiable at http://localhost:3000.

To instead run a more complete build with image uploading support, data persistance, and a custom keycloak admin user run

docker run -p 3000:3000 \
  --env MAPBOX_TOKEN=<your token> \
  --env CLOUDINARY_CLOUD_NAME=<your info> \
  --env CLOUDINARY_KEY=<your info> \
  --env CLOUDINARY_SECRET=<your info> \
  --env APIKEY=<project_api_key> \
  -v mongodb_data:/data/db \
  digiprime

Get in contact with me to get the keys to run a proper version.

This starts the Digiprime server on http://localhost:3000.

Environment variables

Required environment variables:

  • MAPBOX_TOKEN: Mapbox API key.
  • SECRET: Key to encrypt cookies. Default value is thisshouldbeabettersecret so this should be set to another value for the server to be secure. The way it is set up is that it accepts a comma separated list of secrets, where the first one is used to sign new cookies. This allows for rolling updates of secrets, example new,old. See express-session for more information.
  • CLOUDINARY_CLOUD_NAME: Cloudinary cloud name.
  • CLOUDINARY_KEY: Cloudinary API key.
  • CLOUDINARY_SECRET: Cloudinary secret.

Configurable values:

  • BASE_URL: If the application is served on a subpath, this controls which one, default: "".
  • NODE_ENV: defaults to development, can optionally be set to production to hide debug information such as stack traces.
  • AUTH_BASE_URL: default path to the auth server.

For completeness, the other environent variables are shown here but they should not be changed.

  • DB_URL: Database URL for Digiprime, can be set to use another database.
  • PORT: Port to launch Digiprime. However, the image only exposes port 3000 so leave this alone.
  • DATABASE_URL: Database URL for Negotiation Engine, can be set to use another database.

Persisting data

To keep data between runs docker volumes should be used.

To persist MongoDB mount /data/db which is where Mongo stores the data.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published