Docker

Installing Docker and Docker-Compose

This example downloads the script from docker and runs it to install the latest stable release of Docker on Linux:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

To download and install docker-compose standalone, run:

curl -SL https://github.com/docker/compose/releases/download/v2.10.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

Set the executable permissions

sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Generate secret variables

You have to generate secret key and initialization vector:

curl -H "Content-Type: application/json" 'https://api.ennote.dev/generate/onetime/secrets'
Outputs example:

{ "secretKey": "eHts9g5AASdkd63pNtSK0ERcg6nwoQEXcR99pLnYBn4=", "initializationVector": "BaT8jIP+PZ5m95eH" }

Configuration environment variables

Environment variables are set using a .env file. Example:

.env

SECRET_KEY= INITIALIZATION_VECTOR= CUSTOMER_NAME= RELEASE=

Parameters
Variable Description Default Required
SECRET_KEY A key, in the context of symmetric cryptography, is something you keep secret. Anyone who knows your key (or can guess it) can decrypt any data you've encrypted with it (or forge any authentication codes you've calculated with it, etc.). n/a Yes
INITIALIZATION_VECTOR An IV or initialization vector is, in its broadest sense, just the initial value used to start some iterated process. The term is used in a couple of different contexts and implies different security requirements in each of them. n/a Yes
CUSTOMER_NAME Name of your company n/a Yes
RELEASE Release version (see section Release Notes ) latest No

Run application

Set RELEASE to your desired application version, defaults to latest. Keeping it latest is not recommended (see section Release Notes)

docker-compose.yml

version: '3.7' services:   ennote-onetime:     image: registry.ennote.dev/ennote/onetime-c:${RELEASE:-latest}     restart: always     ports:       - 8080:8080     env_file:       - .env

Start up the container by executing

docker-compose up -d

Also, you can run application using docker command

docker run -d --env-file .env -p 8080:8080 registry.ennote.dev/ennote/onetime-c:latest