Skip to content

Containers

Anything with a Dockerfile, as an always-on service on Fargate or a scale-to-zero Lambda container.

Applies to EngineCloud
View as Markdown
On this page
  1. Two ways to run a container
  2. What Run needs from your image
  3. Releases for containers

A container app is built from your Dockerfile and listens on a port. Use it for languages other than JavaScript, for frameworks that need a long-lived process, for WebSockets, or when you already have an image.

Two ways to run a container

runtime = "lambda" (default)runtime = "fargate"
Runs onAWS Lambda with your container imageAWS Fargate, one or more tasks
When idlescales to zero; you pay per request and durationat least one task always running
Request lengthup to 15 minutesunlimited
WebSockets, long connectionsnoyes
Sizeup to 10 GB memoryup to 16 vCPU and 120 GB memory
Good forAPIs with irregular trafficsteady traffic, sockets, background loops

lambda is the default; fargate is billed for every hour its tasks are on, so an app chooses it only for what a function cannot do (Functions or containers). Both receive HTTP through CloudFront, so the address, the domain and the release step are the same as for any other app.

What Run needs from your image

  • It listens on the port in PORT (Run sets it, default 8080).
  • It answers the health check path (/ by default, health_check.path to change it) with a 2xx within the health timeout.
  • It writes logs to standard output and standard error.
  • On SIGTERM it finishes in-flight requests within 30 seconds.

Without a Dockerfile, Run can build an image for Node, Python or Go projects with its own buildpacks; the detected settings are printed in the build log.

Releases for containers

A Fargate release starts the new tasks, waits for their health checks, shifts traffic to them and then stops the old tasks. If the new tasks fail their health checks, the release stops and production keeps the old deploy.

  1. Two ways to run a container
  2. What Run needs from your image
  3. Releases for containers

    Search pages, sections and terms