Get started
Quick Start
Treenq uses a simple tq.json
configuration file to define your service deployment. This file should be placed in the root of your repository.
Basic Configuration
Create a tq.json
file with the following structure:
{ "service": { "name": "my-app", "httpPort": 8000, "dockerfilePath": "Dockerfile" }}
Configuration Options
Required Fields
name
- Name for your service, must be unique across thespace
httpPort
- Internal port your service listens on
Optional Fields
releaseOn
- Release strategy configurationdockerContext
- Docker build context (default:"."
)dockerfilePath
- Path to Dockerfile relative to dockerContext (default:"Dockerfile"
)replicas
- Number of instances (default:1
)runtimeEnvs
- Environment variables as key-value pairs
Release Strategy
The releaseOn
field defines when deployments are triggered:
branch
- Deploy when code is pushed to this branch (e.g.,"main"
,"production"
)tagPrefix
- Deploy when tags matching this prefix are created (use"*"
for any tag), for example a tagPrefix “app-v” will match a tag “app-v1.0.1”
By default a connected repository branch is released
{ "service": { "releaseOn": { "branch": "main" } }}
Or for tag-based releases:
{ "service": { "releaseOn": { "tagPrefix": "v" } }}
Resource Configuration
Configure compute resources using computationResource
:
{ "service": { "name": "my-app", "httpPort": 8000, "computationResource": { "cpuUnits": 1000, "memoryMibs": 2048, "diskGibs": 20 } }}
Resource Defaults:
- CPU: 1000 units (1 CPU)
- Memory: 2048 MiB (2 GB)
- Disk: 20 GiB
Complete Example
{ "service": { "name": "web-api", "dockerfilePath": "Dockerfile", "dockerContext": ".", "httpPort": 3000, "releaseOn": { "branch": "main" }, "replicas": 2, "runtimeEnvs": { "NODE_ENV": "production", "API_VERSION": "v1" }, "computationResource": { "cpuUnits": 2000, "memoryMibs": 4096, "diskGibs": 50 } }}
Next Steps
- Add
tq.json
to your repository root - Connect your GitHub repository to Treenq
- Push changes to trigger deployment