Skip to content

Installation

martiliones edited this page Jun 20, 2024 · 12 revisions

Tip

See the Migration Guide if you are migrating from the Info Service v3 for a rapid start.

There are 3 ways to install Currencyinfo depending on your needs:

  • Docker: This is the recommend and supported way for self-hosting Currencyinfo.
  • From source: If you are developing Currencyinfo or need to run on a platform that isn't support by the official Docker Images.
  • Development setup: Using docker image for development, see Contributing Guide for details.

Docker

Docker is the recommended way to run Currencyinfo.

Configuration

Using this sample file as a reference create a config.jsonc file to contain configuration for your app.

Docker Compose

It is recommended to use Docker Compose to manage the various docker containers, if your MongoDB is running in the cloud then you may skip this step and run the single Currencyinfo docker container directly.

  1. Install Docker Compose
  2. Optionally, you can create docker-compose.override.yml file to set custom port or restart policy:
services:
  app:
    restart: no
    ports:
      - '8080:8080'

Running

Make sure you are in the same directory as docker-compose.yml and build Currencyinfo with the following command:

docker compose -f docker-compose.prod.yaml build

Once the image is built, you can start Currencyinfo:

docker compose -f docker-compose.prod.yaml up

Note

If you have an override file for additional production settings, add -f docker-compose.override.yaml after -f docker-compose.prod.yaml.

From source

If you would like to build on a platform that is not officially supported then from source is the way to go.

Dependencies

Install the following dependencies:

Download

Clone the source code with the following command or download directly from GitHub:

git clone https://github.com/Adamant-im/currencyinfo.git

Configuration

Using this sample file as a reference create a config.jsonc file to contain configuration for your app:

cp config.default.jsonc config.jsonc

Add the configuration variables to your config file for your port, MongoDB database host, e.g.:

{
  // ...
  "server": {
    "port": 36661,
    "mongodb": {
      "port": 27017,
      "host": "127.0.0.1"
    }
  },
  // ...
}

Building

Install the required application dependencies:

pnpm install

Compile the application:

pnpm run build

Running

You’re ready to start the app:

pnpm run start:prod

Check the output carefully for errors such as connecting to your database.