How Containers work: revisions, instances and scaling

Send us an image and we run it, add instances as traffic grows, and let it sleep when nobody calls it. You don’t manage servers.

Your imageDocker Hub · GHCR · Private1DeployRevisionsr1r2r3One-click rollbackActive revisionUsers / systemsOver HTTPS2Service entryIngress · Invoker tokenInstances (min–max)Instance 1Instance 2Added when busy34Database / CacheSame VPCDATABASE_URLMin 0: after ~15 min with no requests the Container sleeps, with no machine charge. The next request is a bit slower.
Every deploy is a new revision. The active revision runs on between the minimum and maximum number of instances you set, and instances are added and removed with the number of requests.

Step by step, following the numbers

  1. Build your image and push it to a registry, then deploy. Each deploy is saved as a revision, and you can roll back on the Revisions tab.
  2. Users call your app at https://name.containers.region.thailandhosting.com. The entry checks whether it’s open to the internet or only inside the VPC, and whether an Invoker token is needed.
  3. Each request goes to the ready instance with the fewest requests in progress. When instances get busy (requests waiting, or CPU above about 70%), instances are added up to your maximum, and removed a few minutes after traffic drops. Calls from other services inside the VPC (name.internal) reach the first instance.
  4. Your app calls the database or cache over the private network. If they’re linked, the DATABASE_URL variable is set for you.

Your app should do these 4 things

  • Listen on 0.0.0.0 on the port from the $PORT variable, not on localhost.
  • Answer the health check path with a status below 500 when it’s ready for work.
  • Keep files users upload in Object Storage and data in a Database, because instances are added and removed as traffic changes.
  • Write logs to stdout and stderr, and read them on the Logs tab.

Test your image on your own computer first with docker run -e PORT=8080 -p 8080:8080 image. If http://localhost:8080 opens, the deploy will most likely work too.

Still stuck? Let our team help

Open a ticket from the Console. Tell us the site or service, what you did and the message on screen. Our reply comes back in the same ticket, so everything stays in one place.