Skip to content

Project Structure

When your project has multiple components, you can configure each one individually using Embfiles.

Our fullstack app has two components:

Terminal window
emb components
COMPONENT NAME ID CREATED STATUS
--------------------------------------
web
api

Both were auto-discovered by the autodocker plugin. But where do their descriptions and tasks come from?

Each component can have an Embfile.yml that adds component-specific configuration:

Terminal window
cat api/Embfile.yml
description: REST API backend service
tasks:
test:
description: Run API tests
script: npm test
lint:
description: Run linter on API code
script: npm run lint
fail:
description: A task that will fail
script: exit 1

The embfiles plugin loads these files and merges them with the auto-discovered configuration.

To enable Embfile loading, add the plugin to your .emb.yml:

plugins:
- name: autodocker
- name: embfiles # Load Embfile.yml from each component

The order matters - autodocker discovers components first, then embfiles enriches them with additional configuration.

Component Embfiles can include:

  • description - Human-readable description
  • resources - Additional or modified resources
  • tasks - Component-specific tasks
  • flavors - Component-level flavor patches

To see how everything comes together:

Terminal window
emb config print | head -30
components:
web:
resources:
image:
type: docker/image
params: {}
description: Web frontend served by nginx
tasks:
test:
description: Run frontend tests
script: echo 'Running frontend tests...' && exit 0
rootDir: web
api:
resources:
image:
type: docker/image
params: {}
description: REST API backend service
tasks:
test:
description: Run API tests
script: npm test
lint:
description: Run linter on API code
script: npm run lint
fail:
description: A task that will fail
script: exit 1
rootDir: api
defaults: {}

Continue to Environment Variables to learn about the dotenv plugin and variable expansion.