Customizing Container Services

Background

The following are examples of what custom container services can be used for:

  • When recording requests from a service, a local instance may be needed. The local instance of the service can be added here

  • When testing, a custom container can be used to trigger the tests after all the services have initialized. An entrypoint service is provided for this purpose

Customizing

  1. Each workflow provides a docker-compose.yml for the purpose of adding custom container services. It can be accessed in the following location:

.stoobly/docker/<SERVICE-NAME>/<WORKFLOW-NAME>/docker-compose.yml

Modifications to this file will not be overriten when the service create command is re-run.

  1. Custom services should be added under the services property. A custom service also needs to include the workflow name under profiles . For example, if the current workflow is record, then:

$ cat .stoobly/docker/<SERVICE-NAME>/<WORKFLOW-NAME>/docker-compose.yml

services: 
  helloWorld:
    image: hello-world
    profiles:
      - record
  1. Optional: if your custom service requires network access to other container services, then specify the appropriate network. To learn more about which network to specify, see:

Scaffold

For example:

$ cat .stoobly/docker/<SERVICE-NAME>/<WORKFLOW-NAME>/docker-compose.yml

services: 
  helloWorld:
    image: hello-world
    networks:
      - app.egress
    profiles:
      - record

Last updated

Was this helpful?