- Go 1.18 or newer
- Docker 20.10 or newer
- Task build tool
- WSL2
- Docker tasks work natively only under Linux and (possibly) macOS. On Windows use WSL2.
- Protocol buffer compiler with its Go plugins
In order to generate files, necessary for development (eg. gRPC client/server from protobuf schema)
and perform vendoring, execute the dev_prepare
task:
task -- task prepare
Runtime dependencies (eg. MongoDB) are launched as Docker containers and are managed by Docker Compose. The Compose operations are wrapped into Task tasks.
Make sure that the Docker daemon is running and execute:
task dev:compose:up
In order to remove the containers and their data, run:
task dev:compose:down
To execute arbitrary Docker Compose command <COMMAND>
, call:
task dist:compose -- <COMMAND>
Since the local MongoDB instance is run is the replica set mode and advertises the internal Docker hostname
to other containers, in order to connect to it from the host machine it is necessary to configure the client to
ignore the advertised hostname and connect to the instance directly,
by specifying the directConnection
option in the connection string:
mongodb://root:password@localhost:27017/?directConnection=true
Individual services can be built and executed locally with the run_*
Task tasks.
For example, in order to run the API gateway service, execute:
task -- task api_gateway:run
In order to launch Docker container with the project's directory mounted, execute:
task
To execute arbitrary command COMMAND
in the container,
pass it to the Task after --
:
task -- COMMAND