In addition to the containers described in your docker-compose file, another container is created when an environment is spawned - the dev container (named
dev by default).
The purpose of this container is to mimic the developer's computer's role when developing locally.
You can run scripts, build your code, run tests, and do anything you're used to doing while developing as if it were your computer.
The repository's folder is copied (except for what's explicitly in .gitignore) to the dev container when spawning an environment, and a two-way sync makes sure these directories stay synchronized.
Two important things happen in the dev container during environment spawning -
Include all the dependencies for these scripts by editing the dev container's Dockerfile.
Default Dev Container
The default dev container includes many useful tools for development and environment management. The docker image and the description of its content can be found here.
Running Raftt Commands
We added a reduced copy of Raftt's CLI into the dev container.
This allows users to run some of Raftt's commands after SSHing to the dev container using
raftt sh dev command.
The allowed commands affect the containers and not the images or the environment itself. The following commands are available -
cp- Copy files to and from a service.
help- Help with any command.
logs- Get the logs of a service.
restart- Restart one or more services.
sh- Connect or run a command on a service.
stop- Stop one or more services.
version- Show the Raftt version information.
Because Raftt depends on the dev container for running various scripts, the dev container may not depend on other services.