decentralized-identity / ion

The Identity Overlay Network (ION) is a DID Method implementation using the Sidetree protocol atop Bitcoin
https://identity.foundation/ion
Apache License 2.0
1.23k stars 170 forks source link

Questions regarding Docker integration #190

Open louneskmt opened 3 years ago

louneskmt commented 3 years ago

Hey!

I'm an Umbrel active contributor and I'm currently looking into a Docker implementation, following Umbrel requirements (e.g. prebuilt images). I've a few questions regarding this.

Here is an example of what it could look like. Please note that this is an early not-working version.

  1. Configuration logic

Your install guide specifies that the build command (npm run build) has to be executed every time a configuration JSON file is modified. This command corresponds to the following:

https://github.com/decentralized-identity/ion/blob/11481c35ca9af3a4bb9390b92501567d22fd3270/package.json#L54

which compile Typescript files and copy configuration files from json and tests to the dist dir.

Does this need to be run even if the config files paths are not set to default (i.e. ION_BITCOIN_CONFIG_FILE_PATH, ION_BITCOIN_VERSIONING_CONFIG_FILE_PATH, ION_CORE_CONFIG_FILE_PATH, ION_CORE_VERSIONING_CONFIG_FILE_PATH are set to custom values)? If not, would it be possible to run the tsc only once on build? This allows to build ion in the Dockerfile instead of at each run (exemple of simple entrypoint), and to run the container more deterministically (less chance for the container to fail because of a possible build error).

  1. Persistent data

What directories or files need to be persisted between sessions (i.e. saved to the host filesystem)? Is persisting mongo database and ipfs directory enough, or is there anything else I'm missing?

  1. Use of environment variables

Dedicated issue: #189

Thanks!

thehenrytsai commented 3 years ago
  1. You are correct that if you override the config file paths through environment variables, then there is no need to rebuild every time config parameters are modified. The guide didn't want to get into the nuisance for beginners, thus offers fool-proof instructions, but feel free to submit a PR if you think this info would actually be useful.
  2. You are right again, you didn't miss anything.