Services
Services are containers, that are triggered by an HTTP endpoint.
Examples of these are:
- Websites
- APIs
- Webhooks
For these endpoints, we also use our scale-to-zero technology, to shut down unused resources and initialize only when a request comes in.
How it works
By creating a service, we create a public endpoint and issue a valid TLS certificate.
This endpoint, by default hosts an empty HTTP server where you can test the setup.
By providing us with a container image we can replace our static placeholder with your website/API.
What is required of the container image?
Each container image is initialized on demand. So any system deployed to DTZ needs to keep that in mind.
By default, DTZ sets a PORT
environment variable for the container and expects the instance to be launched on that port. If your application needs to be run on a specific port, you can override this variable with your software-specific port.
To check the availability of the deployed application on startup, the runtime call the port with a HEAD /
-request. If the response is not erroneous, the load balancer marks this backend as running.
Environment Variables from the runtime
variable | settable | description |
---|---|---|
PORT | yes | application listener port |
DTZ_ACCESS_TOKEN | yes (identity can be changed) | JWT generate from the context that allows resources to be accessed within the context. |
DTZ_CONTEXT_ID | no | DTZ context that the current application is running in |