Run services in Docker

On this page you will find steps to run HUMAN Protocol services locally in Docker using testnet.

Everything you need to spin up services is located in docker-setup folder, so let’s make it our working directory:

cd docker-setup/

This setup is focused on using testnet instead of running web3 locally, so you can have some persistent data on chain and on subgraph. It also uses different set of docker containers (and volumes) for storing DB-like data, so anything in human-protocol-local-setup is persistent for you (unless you remove it by pruning your local docker).

The above is not the case for docker-compose.dev.yml that is expected to be used for local dev only and has separate set of services and volumes that can be safely pruned.


Preparing .env files

Before you build or run any services, you need to prepare env file named .env for it and fill it with valid values (see Setting up environment variables). Docker Compose will use created env file from the specific service folder as a base and override only necessary values.

If you have multiple files, such as .env.{NODE_ENV}, .env.local and .env, then they are resolved in corresponding order, e.g. for NODE_ENV=development env files are parsed from left to right: .env.development, .env.local , .env and the first value set for a variable will win.


Creating infra and building images

In order to make sure that all necessary infra is set up and services can be started, run next command:

make check-env-file infra-up

The step above:

  • ensures that no environment variables are missing for Docker Compose setup

  • ensures that human-cvat-bridge network (that is needed to have stable communication between HUMAN Protocol and CVAT) is created

  • spins up necessary infrastructure containers (Postgre, Redis, Minio) with pre-defined setup for all services

Since docker setup is focused on using testn

After the above command is successful, you can either build all services w/o running:

make build-services

or build and run them

# To build and run all services
make services-up
# To build and run specific services (use service names from docker-compose as args)
make services-up service1 service2

Last updated

Was this helpful?