Skip to content

service

service(input: WithMeta<ContainerInput>): ServiceModel

Create a service container model.

Service containers run alongside the job and are accessible via their key in jobs.<job_id>.services. The input shape is identical to container, but the returned model is branded as a ServiceModel so it can only be placed in the services map.

Parameter Type Description

input

WithMeta<ContainerInput>

Container configuration and optional metadata.

ServiceModel

A branded ServiceModel.

const redis = service({
image: "redis:7",
ports: ["6379:6379"],
});