The seed field lets you copy files into a container and optionally run initialization commands. This is useful for database seeding, loading fixtures, or running migrations.
Field
Type
Required
Description
prestart
SeedEntry[]
No
Files to copy into the container before it starts. No commands can be run.
poststart
SeedEntry[]
No
Files to copy and commands to run after the container starts and is healthy.
Seed entry fields
Field
Type
Required
Description
source
string
Yes
Path to the file or directory on the host, relative to the project root.
destination
string
Yes
Path inside the container where the file will be copied.
cmd
string
No
Command to run inside the container after copying (only for poststart).
Prestart seeds run after the container is created but before it starts. Files are copied into the stopped container. This is ideal for configuration files that must be in place before the process launches.
Poststart seeds run after the container starts and is healthy. Files are copied first, then the optional cmd is executed inside the container via sh -c. This is ideal for database initialization, running migrations, or loading fixtures.
Template syntax
Environment variable values support template expressions:
Template
Description
Example
${services.<name>.host}
Hostname of another service
${services.postgres.host}
${services.<name>.port}
Port of another service
${services.api.port}
${services.<name>.env.<VAR>}
Env var from another service
${services.postgres.env.POSTGRES_URL}
${secrets.<KEY>}
Injected secret
${secrets.STRIPE_API_KEY}
${Generate(n)}
Random string of length n
${Generate(16)}
${<VAR>}
Self-reference to own env var
${POSTGRES_USER}
Secrets
Secrets referenced with ${secrets.<KEY>} are provided at runtime via: