Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Devcontainer Customization Reference

The devcontainer spec supports customizations; we put them in customizations.devconcurrent. Note that we also support overrides in config.toml, so you could configure devconcurrent, or even a full devcontainer.json in your personal config file for a repository that does not have it set up.

  • worktreeFolder — The directory where devconcurrent will place worktrees.
  • mountGit — Whether to mount the project’s git directory into each workspace’s devcontainer.
  • proxy — Configure DNS hostnames and HTTP proxy.
  • env.<name> — Define shell variables

worktreeFolder

The directory where devconcurrent will place worktrees.

Type: string

mountGit

Whether to mount the project’s git directory into each workspace’s devcontainer.

Git worktrees have a simple .git file that points to the actual .git directory. If that directory isn’t available, then no git commands will work. By mounting it at its original path in the devcontainer, git should just work, both inside and out of the container.

Type: boolean

Default: true

proxy

Configure DNS hostnames and HTTP proxy.

Type: object

proxy.enable

Enable the devconcurrent DNS and HTTP proxy for this project.

Type: boolean

Default: false

proxy.hostname

Handlebars template for the proxied hostname, used by every service that does not set its own.

Available variables:

  • root (bool) — whether this is the root workspace
  • project — project name
  • workspace — workspace name
  • service — name of the service from compose

Type: string

Default: "{{workspace}}.{{service}}.test"

proxy.services.<name>

Configure proxy settings for each docker compose service.

Type: object

proxy.services.<name>.hostname

Handlebars template for this service’s hostname. Overrides the project-level hostname.

Type: string

Example:

You may want a simpler hostname for your primary service.

{
  ...,
  "customizations": {
    "devconcurrent": {
      "proxy": {
        "enable": true,
        "services": {
          "app": {
            "httpProxyPort": 3000,
            "hostname": "{{workspace}.test"
          }
        }
      }
    }
  }
}

proxy.services.<name>.httpProxyPort

If set, devconcurrent will run an HTTP proxy on ports 80 and 443 to this port in your container, performing TLS termination on 443.

If this service runs a web service, put its port here.

Type: integer

env.<name>

Define shell variables

These are rendered by dc show env or automatically set if shell.exportEnv is true.

The values are given by handlebars templates with the following:

  • The hostname helper gives the hostname for a service.
  • The following variables are populated: project, workspace, and root.

Type: string

Example:

{
  "BASE_URL": "{{ hostname 'app' }}",
  "DATABASE_URL": "postgres://postgres:postgres@{{hostname 'postgres'}}:5432/db"
}