Getting Started /
Build and deploy your code
This walkthrough will take you through the steps to build and deploy your code in one simple service.
Combined services are a self-contained continuous integration and continuous delivery system.
It's as easy as choosing a branch from a Git repository to automatically build and deploy from.
Combined services cannot be added to a pipeline as they act as a self-contained pipeline. If you want to create a more complex workflow, the set up a pipeline walkthrough will take you through all the steps.
Most aspects of a combined service can be configured after creation - including the linked Git repository and branch.
- Choose service from the create new menu in the top right corner of the dashboard
- Select combined service and enter a name
- Select the repository from the drop-down list. You can search for a specific repository, and filter by service or owner. If you're a member of a team and your team administrator has restricted the team to a namespace, you'll need a linked account with access to that namespace.
- Select the branch you want the service to build from
- Choose your build type: Dockerfile if you have a custom Dockerfile in your registry or Buildpack to automatically build your application
- Dockerfile only: verify your Dockerfile. If your Dockerfile and/or build context are not in the repository's root, specify the relative paths.
- Add build arguments or runtime variables if required
- Northflank will automatically detect and add ports exposed in your Dockerfile, or add a public port for Buildpacks. Adding and editing ports will be covered in more detail later in this walkthrough.
- Leave the compute plan and instances as default for now, this walkthough will cover scaling resources later
- Click create service
You will be taken to your new service's overview after creating it, you can find your service again by clicking on the services button in the project menu on the left.
Your combined service will immediately start to build the latest commit to your branch.
Your combined service has CI/CD enabled by default and will automatically build and deploy the latest commits to your linked repository branch.
Combined service controls
The service header displays some useful details of the service at a glance:
- Public domains
- Service region
- Git repository and branch
- Currently deployed commit hash
- Active containers and their status
You can manage your service using the controls found at the top of the dashboard:
- You can toggle CI (continuous integration) to enable or disable the automatic build of the latest commit to the repository, branch, or pull request.
- You can toggle CD (continuous delivery) to enable or disable the automatic deployment of new builds to your service. All instances will be redeployed with the new build. If you also have CI enabled, your service will automatically build and deploy the latest commits from your tracked branch.
- You can trigger a restart to automatically replace the running containers with new instances. An old container will not be halted until its replacement is confirmed running.
- You can scale the amount of instances up or down by entering the desired amount and saving.
- You can pause to disable CI/CD and scale the service to 0 instances.
The service overview contains real-time information on:
- Recent builds by the service
- Latest commits to the linked repository branch
- Active containers and their status
- Any configured public and private ports
- Local access, which includes commands to connect to the service on your machine via the Northflank CLI
This walkthrough will take you through two commons tasks to configure a deployment: exposing a public port and increasing the resources available to your service.
Add a public port
Northflank can automatically detect and configure ports exposed in your Dockerfile, however you will likely want to manually add or edit ports.
If you are using a Dockerfile it should expose the port(s) configured in your application/service. For example if you have an Express.js application configured to listen for requests on port 3000, your Dockerfile should include
- Go to the ports & DNS page in your service
- Click add port
- Enter the port that matches one exposed by your Dockerfile or application
- Select the protocol. HTTP can be used for public ports, TCP and UDP can only be used for private, internal ports.
- Select publicly expose this port to the internet for a public endpoint
- Click update to use the newly configured port
- Visit your new public Northflank domain, which takes the format:
Northflank will automatically generate TLS certificates for your public ports using Let's Encrypt .
If the website or service is inaccessible, check that the correct ports exposed by your application and Dockerfile.
Increase your service's resources
The resources dedicated to your services will determine how they perform under load.
To build your code more quickly or run intensive applications you may need to increase the compute plan (CPU and memory) of your service.
If you expect or experience a high volume of traffic to your deployment, you should scale up the number of replicas. Northflank will automatically load-balance incoming traffic to your replicas to ensure maximum availability.
You can quickly scale the number of containers your deployment is running from the service header controls, but you can scale your service and increase other resources from the resources page.
- Go the resources page in your service
- Select a new compute plan with a combination of a higher share of a vCPU, or a dedicated CPU, and higher memory
- Increase the number of containers
- Update & restart your service to deploy that number of new containers with the selected resources
If you are unable to increase your service's resources further you may be using a free project, which you will need to upgrade. If you require more computing power, replicas, or storage than available by default please contact email@example.com.
Now you have built and run your first service on Northflank, made it available online via a public port, and increased the available resources and number of containers running your application.
Next you can learn about the other features and options available on your services, or learn how to create and manage development pipelines to enjoy a seamless devops experience.
Set up a pipeline
Manage your workflow and release your code in an intuitive pipeline.
Add and verify domain
Add your domain name to your Northflank account and link it to a public port.
Configure health checks
Monitor the uptime and success of your deployed services and builds to ensure your code runs correctly and is always available.
View logs and metrics
View detailed, real-time logs and metrics from builds, deployments, and more.
Deploy a database
Create a database to use with your Northflank deployments.
Set build arguments and inject environment variables into running deployments.