Deployments
A Deployment in Serversinc represents the process of creating or updating the running Container for an Application.
Deployments ensure that your application is running with the latest code, configuration, and container image.
How Deployments Work
Section titled “How Deployments Work”-
Build or Image Selection
- For Docker Applications: The deployment uses the image you provide directly.
- For GitHub Applications: A build process creates a new Docker image (see Builds).
-
Container Creation
- Serversinc launches new containers from the image.
- Containers inherit environment variables, volumes, labels, and port mappings defined at the Application level.
-
Traefik Integration (if domains are configured)
- Deployment ensures Traefik labels are applied for routing and SSL.
-
Old Containers Removed
- After new containers are healthy, old containers are stopped and removed (zero-downtime deploys are supported if Traefik is handling routing).
Builds
Section titled “Builds”For GitHub Applications, a deployment begins with a Build.
Builds use a Buildpack Docker container:
- The Buildpack inspects the repository to detect the project’s language/framework.
- It automatically compiles source code, installs dependencies, and packages the app into a Docker image.
- Once built, the Docker image is tagged and stored locally on the server.
- The build process then triggers a Deploy using the new image.
Read more: Buildpacks
Example Flow
Section titled “Example Flow”- Push new code to GitHub.
- Serversinc receives the webhook and starts a build.
- Buildpack generates a Docker image from your repo.
- A new Deployment is created using that image.
- Application containers are updated with the new code.
Note: Builds run on the same server where the Application is deployed.
Deployment Lifecycle
Section titled “Deployment Lifecycle”Every deployment goes through states:
- Created – Deployment object created.
- Started – Deployment process has begun.
- Succeeded – New containers are running successfully.
- Failed – Deployment encountered an error (image build failure, container startup issues, etc.).
Triggering Deployments via Endpoint
Section titled “Triggering Deployments via Endpoint”Applications expose a Deploy Hook endpoint that can be used to trigger a deployment externally (e.g., from CI/CD pipelines).
Endpoint
POST /v1/events/{deploy_hook}
**Headers**X-Deploy-Secret: <your_application_deploy_secret>
Both the deploy_hook
and the X-Deploy-Secret
can be found in Application > Settings.
Passing a Tag
Section titled “Passing a Tag”You can optionally pass a tag
value in the request body or query string:
{ "tag": "v2.0.1"}
This updates the Application’s image tag. If the image:tag
does not exist on the server, Serversinc automatically pulls it before starting the deployment.
Notifications
Deployment events are available for alerts via Notifications:
deployment.created
– A new deployment was created.deployment.started
– Deployment process started.deployment.deleted
– Deployment was deleted.deployment.failed
– Deployment failed.deployment.succeeded
– Deployment completed successfully.