Dokemon Logo

Guides

Compose

Compose Projects

Inside your node you have the Compose section where you can create compose projects for that node.

Types of Projects

Local

You can create a compose definition by clicking the Create button. This compose definition is stored in Dokemon SQLite database file /data/db.

GitHub

You can add a compose definition from GitHub by clicking the Add from GitHub button. You can open your compose YAML file on GitHub and copy the URL from the browser and paste it into the form.

If you are using a private GitHub repository you will need to create a Personal Access Token on GitHub with read access to your repository.

Library

You can add a compose definition from your Compose Library by clicking the Add from Library button.

Note that library project defintions cannot be edited from here. You can only edit them from the Compose Library. This is because the Compose Library is meant for sharing the same compose definition across multiple nodes.

Variables

Below your compose definition you have Add Variable button to create variables for your project.

The variables can be included in your servers using the environment section or env_file section in your compose definition.

Using environment

You can simply list the names of the variables as below in the environment section of your service.

services:
  myservice:
    environment:
      - MY_VARIABLE_1
      - MY_VARIABLE_2
      - MY_VARIABLE_3

You can also use below syntax. This is useful when you want need to set the variable for the service with a different name like in the third variable shown below.

services:
  myservice:
    environment:
      - MY_VARIABLE_1=$MY_VARIABLE_1
      - MY_VARIABLE_2=${MY_VARIABLE_2}
      - NEW_VAR_3=${MY_VARIABLE_3}

Using env_file

If you need to include a long list of variables in all the services the above syntax would be difficult to maintain. In such cases you can use the below shorter syntax.

services:
  myservice:
    env_file:
      - .env

When you deploy your compose defintion, Dokemon will create a temporary file called .env and add all the variables to it. The above syntax reads the variables from this .env file. Once the deployment is complete the temporary .env file is deleted.

Global Environment Variables

If you have environment specific variables defined in the top-level Variables section and if your Node has the environment assigned, those variables are automatically passed to your compose during deployment.

The variables defined in your compose definition have higher precedence than the Global Environment variables.

Previous
Compose Library