Services Commands:

services:listLists services within a project
services:add<service-name>requiredAdds a new service
services:logs<service-name>requiredShows logs of a service, use --follow to steam logs
services:remove<service-name>requiredRemoves a service
services:restart<service-name>requiredRestart a service
services:start<service-name>requiredStarts a service
services:stop<service-name>requiredStops a service
services:update<service-name>requiredUpdates a service

services:add

Services are core concept in Blink. You can create as many services as you need with services:add. It can be a deployment or storage service.

blink services:add
Enter service name: test
Select service type:
> deployment
  storage

Deployment service

Service that runs a docker container. It can be any public docker image or your own dockerised application You will be prompted to enter a docker image name. We will attempt to find this image locally or pull it from the docker hub.

Enter image name: nmatsui/hello-world-api
____________________________________________________________
Enter command with arguments (Leave empty for default): 
____________________________________________________________
Start the service immediately?
> Yes
  No
____________________________________________________________
> Checking image "nmatsui/hello-world-api"
latest: Pulling from nmatsui/hello-world-api
0c40a6f73ece: Pull complete
Digest: sha256:09f8a1eae446be949be701bbc16e4ff81e3810d4902924023b989099ad21c61b
Status: Downloaded newer image for nmatsui/hello-world-api:latest
> Adding service "hello-world-api"
> Adding domains for service "hello-world-api"
hello-world-api-9094347d-167-172-176-166.traefik.me
> Adding port mappings for service "hello-world-api"
0.0.0.0:443/http -> 5000
> Creating container (172.29.0.8)
> Updating Traefik static config
> Updating Traefik dynamic config
> Starting container "542634bf8970db2dfa40abdd888eef4fd4d83751275c5d0a4e2250e88cad7b27"

If you want to deploy your own dockerised application, you would need to lad docker image first. You can do this by running docker build -t <image-name> . in the root of your application.

Once you’ve verified that the image is built correctly, you can deploy it with deploy.sh script

deploy.sh
docker build --platform linux/amd64 -t app-name -f Dockerfile ..
docker save app-name | bzip2 | ssh root@< vps_ip > "docker load | blink services:restart app-name"
important

Make sure your platform is matching target platform of your server. Othervise you would need to path --platform flag to docker build command. linux/amd64 | linux/arm64 | linux/x86_64

Storage service

Is a service for hosting databases Currently we support following databases:

Under the hood we will check if server matches the requirements for the database, mount static storage for data persistence and setup the database including ssl certificates and domain name.

blink services:add
Enter service name: local-storage
Select service type:
  deployment
> storage

You can specify the version of the database you want to use, or leave it empty to use the latest version.

Start the service immediately?
> Checking image "postgres:latest"
latest: Pulling from library/postgres
Digest: sha256:fe4efc6901dda0d952306fd962643d8022d7bb773ffe13fe8a21551b9276e50c
Status: Image is up to date for postgres:latest
> Adding service "pg"
> Setting bind mounts for service "pg"
  /var/blink/analytic/pg -> /var/lib/postgresql/data
> Adding domains for service "pg"
  pg-bcde2d45-167-172-176-166.traefik.me
> Adding port mappings for service "pg"
  0.0.0.0:5432/tcp -> 5432
> Generating credentials
  Host: 172.29.0.9
  Port: 5432
  User: postgres
  Password: VaJ1Ge46XITWDZbr
  Database: postgres
> Creating container (172.29.0.9)
> Updating Traefik static config
> Updating Traefik dynamic config
> Starting container "a399c523298e8016b85b01edab1b0560dd96561eea64240ec86cb776e4d7bfe5"

By default we expose your database to public for easy connection. If you want to restrict access to your database, you can do so by setting up blink ports:remove and blink domains:remove for your service.