Env Sync Configuration
You can define the behavior of Env Sync for individual Velocity Services by setting values in the
services.<service_name>.syncsection of your
command: sh # Override the container command with 'sh -c yarn start'
- yarn start
update_image: false # Build and use a new docker image on start
For example, in the above
.velocity.yamlfile the Velocity Service
backendhas been configured to, upon container restart, replace the default container
CMDwith a new command --
sh -c yarn start.
Similarly, the Velocity Service
websitehas been configured to not rebuild the related Docker image when a user first starts Env Sync by running
veloctl env sync --service website, and instead only rebuild it when a code change is detected.
A command to run in place of the default container
CMDat container restart.
command: ./app # Override the container command with './app'
Build and use a new docker image on start (default: 'false').
update_image: true # Build and use a new docker image on start and use the existing running image instead
Skips building a new image on start (default: 'true').
skip_first_build: true # Keep the existing image on start
Configure the remote rebuilding of your container image.
velocity_builder: # Configuration for the remote build
args: # Docker build command arguments
- -f ./Dockerfile .
env: # Environment variables to inject into the builder
env_from_secrets: # Secrets to load as environment variables into the builder
- name: my-secret
Files and directories in which code changes should not trigger an image rebuild.
exclude_patterns: # Paths to exclude from change detection
The debug command to run in place of the default container
CMDat container restart and the ports to expose.
debug: # Remote debugging configuration
command: COMMAND # The command to run the remote debugger
debugger_port: 9229 # The port the debugger listens to
local_port: 9229 # The port to expose locally on the developer's machine
ssh: # SSH exposure configuration (related to remote debugging)
expose: false # Should we expose SSH locally from the container (disabled by default, needed only in some cases)
local_port: 6060 # The port to expose the SSH locally on the developer's machine
Configure port-forwards that will be established when
env syncstarts for accessing remote services.
interface: 0.0.0.0 # The bind address used when running port-forward. Defaults to 'localhost'
forward: # Run port-forward to specific services
- 3000 # Run port-forward from '0.0.0.0:3000' to '<current-service>:3000'
- 8080:3000 # Run port-forward from '0.0.0.0:8080' to '<current-serivce>:3000'
- 8082:website:3000 # Run port-forward from '0.0.0.0:8082' to 'website:3000'
Define a mapping of the local development directory to the source code directory in the remote container.
live_updates: # Paths to watch for file sync
Define action hooks that are triggered on specific files changes.
action_hooks: # Actions to run after syncing specific files/paths
- path: ./Dockerfile
- path: ./my/path