Forge Container services is now in Preview, and therefore fully supported. However, it remains under active development and may be subject to shorter deprecation windows. Preview features are suitable for early adopters in production environments.
We release preview features so partners and developers can study, test, and integrate them prior to General Availability (GA). For more details, see Forge EAP, Preview, and GA.
The endpoint module described on this page is also documented in the Endpoint manifest reference.
To customize Forge Container services configuration by environment type and placement, see Manifest overrides.
Forge features a top-level manifest property named services that lets you define a service and its corresponding container.
It supports the following properties:
| Property | Required? | Description |
|---|---|---|
key | Yes | A key for the service, which modules (like endpoint) can refer to. Each service in the manifest must have a unique key (regex: ^[a-zA-Z0-9_-]+$) |
containers | Yes | Defines a container (and its properties) within the service. The containers property supports its own set of properties to configure a container; see Property: containers for details. |
tunnel | No | Defines the local port that invocations of the service should be made to whilst tunnelling. If undefined, requests will be made to port 7071. See Property: tunnel for details. |
scaling | No | Horizontal scaling configuration defining the min & max number of container instances to run. See Property: scaling for details. |
The ability to configure multiple services and containers per app is available behind a feature flag. Contact us if your app requires multiple services. See Roadmap for details on upcoming updates.
The containers property lets you configure a container’s resource, scaling, and health check settings:
| Property | Required? | Description |
|---|---|---|
key | Yes | A unique key that maps to the container’s image repository URI. This key is created with the forge containers create command; to view all container keys and their corresponding repository URIs, use the forge repositories list command. |
tag | Yes | The tag of the image that Forge should use to deploy the container. This image (and tag) must exist in the Forge Container Registry. |
resources | Yes | Vertical scaling configuration defining CPU and memory available to your container. See Resources. |
health | Yes | Configuration for an HTTP Health check that the Forge Platform uses to determine container availability and health. See Health. |
tunnel | No | Configuration to deploy the container locally and start it automatically with forge tunnel. These settings follow the same syntax as a standard docker compose file. See Testing a containerised service locally for more information. |
The resources property defines what compute resources are allocated to the container.
| Property | Required? | Description |
|---|---|---|
cpu | Yes | Reserved amount of CPU units for the container in either cpu or millicpu, for example "1" or "1000m". Must be one of the valid resource size combinations listed below. |
memory | Yes | Reserved amount of memory units for the container in either mebibytes or gibibytes, for example "2048Mi" or "2Gi". Must be one of the valid resource size combinations listed below. |
The cpu and memory values must be one of the following supported combinations. Deployments with unsupported combinations will fail.
| CPU | Memory |
|---|---|
4000m | 16Gi |
4000m | 8Gi |
2000m | 4Gi |
1000m | 2Gi |
500m | 1Gi |
250m | 512Mi |
125m | 256Mi |
60m | 128Mi |
30m | 64Mi |
The health property defines how your container is determined as healthy and ready to receive traffic. For more details around timing for configured container health checks during deployment and runtime, see Deploy the Service.
| Property | Required? | Description |
|---|---|---|
type | Yes | The type of health check operation to perform. Currently only http is supported. |
route | Yes | The operation that will be performed depending on the type. When using http:
|
The scaling property defines how the service should scale the number of instances.
| Property | Required? | Description |
|---|---|---|
min | Yes | The minimum number of instances that the service can scale down to. |
max | Yes | The maximum number of instances that the service can scale up to. |
profile | No | The scaling configuration used by this service. |
For now, the only supported profile is default.
With this profile, scaling behaviors are triggered whenever the average CPU or memory usage reaches the following thresholds:
| Resource | Average resource usage threshold |
|---|---|
| CPU | 50% |
| Memory | 70% |
The following table describes the default profile’s scaling behavior:
| Scaling behavior | Scale by | Trigger |
|---|---|---|
| Scale Up | 100% | Instances reached the average usage threshold. |
| Scale Down | 50% | Instances stay under the average usage threshold for a full 300 seconds. |
Forge Container services checks average resource usage every 15 seconds.
You can configure a container service to scale down to zero running instances when it is idle. This can help reduce costs for containers used in non-production environments by ensuring that no instances are running when there is no traffic. Scaling a container service to zero is supported in DEVELOPMENT and STAGING environments.
To enable this, set min to 0 in your service's scaling configuration:
1 2services: - key: example-service scaling: min: 0 max: 2
With scale to zero enabled, a container service scales down to 0 running instances if it receives no traffic for 15 minutes.
When the next request arrives, Forge returns a 503 response and starts scaling the service back up.
The service typically becomes available within a few minutes. Once the container has scaled up, subsequent requests are processed normally.
When enabling scale to zero, consider the following differences in behavior:
The tunnel property lets you configure settings for running the container locally, including which port service invocations should be made to.
| Property | Required? | Description |
|---|---|---|
port | Yes | The port of the locally-deployed service. While tunnelling, any invocations of this service will be made to localhost:${port}. |
docker | No | Docker Compose configuration for building and running the container locally when Only a subset of Docker Compose service properties is supported, primarily for enabling tunnelling features (including hot reloading). |
See Testing a containerised service locally for more details.
The following snippet shows a service named java-service, which is backed by a container of the same name. The service is accessible via the /webtrigger route on the webtrigger-ep endpoint module.
1 2modules: webtrigger: - key: container-webtrigger endpoint: webtrigger-ep endpoint: - key: webtrigger-ep service: java-service route: path: /webtrigger services: - key: java-service containers: - key: java-service tag: latest resources: cpu: "1" memory: "2Gi" health: type: http route: path: "/healthcheck" scaling: min: 1 max: 1
Rate this page: