Skip to main content

Dev Container

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 -

  1. The execution of the warmup script.
  2. The execution of the custom database seeding scripts.

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 -

  1. cp - Copy files to and from a service.
  2. help - Help with any command.
  3. logs - Get the logs of a service.
  4. restart - Restart one or more services.
  5. sh - Connect or run a command on a service.
  6. stop - Stop one or more services.
  7. 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.