Skip to content

Nestjs application source code to learn how to deploy it with Axebow, easy and fast (< 2 min).

Notifications You must be signed in to change notification settings

eruiz/axebow-first-service

Repository files navigation

Service web application for Axebow

Introduction

This project contains a Nestjs-Handlebars web application source code to learn how to deploy a service web application with Axebow, the easiest Platform Engineering to deploy cloud native services.

How to deploy

A ready to use container image has been published at ghcr.io/eruiz/axebow-first-service:1.0, deploy it following steps below:

  1. Sign in to the Axebow web interface

    Login
  2. In the Homepage, on top toolbar, press the Run Service button.

    axebow homepage toolbar
  3. In the first step How to run the service, set the required fields:

    • The Container registry URL in which you pushed the container image.

    • The Image tag with which you named the container image.

    • For example, if you used GitHub Packages:

      axebow run service step01
  4. Second step, Excecution environment, set the required fields again:

    • Tenant, choose the freemium tenant which allow to deploy services at no cost.

      Important

      The freemium tenant is limited to 2 vCPUs and 4 GB of memory for each user. Moreover, the resources and deployed services are cleaned each 2 hours. Create your own Accounts and Environments to overpass these limits.

    • CPU requirements, set 0.5

    • Memory requirements, set 0.5

    • Service name, the service unique identifier.

    • For example, if you used GitHub Packages:

      axebow run service step02
  5. Third step, Configure the service, set the domain resource that will allow to send requests to the service web application from Internet.

    Important

    At the date of writing this guide, only axebow.cloud subdomains are supported.

    To create a new domain, just press on manage resources button and write the subdomain name, Axebow will generate the domain.

    axebow run service step03 03

    Example:

    axebow run service step03 01

    The service web application doesn’t need to receive configuration injected via environment variables, so you let the Configuration parameters table empty.

  6. Last step, Connect your service, create a public port, accesible from the Internet and link it to the port the container listens and the service web application attends the HTTPS requests.

    • Channel name, the communication channel unique identifier.

    • Container port, the exposed port.

      Tip

      You can get info about the container exposed ports in the Dockerfile. If you open the Dockerfile you’ll see the container listens on port 3000.

      EXPOSE 3000

    • Protocol, select HTTPS because the service is a web application.

    • Public port / Domain, select the domain created in the step 3.

    • Example:

      axebow run service step04
  7. Finally run the service web application by pressing the button Save

Navigate to the Runtime Dashboard and you’ll see the serice web application running. Click on Domains list and press on the domain URL to navigate to the web application.

axebow run service step05

Build your own container image

Follow this steps to build and publish your own container image:

  1. Clone this repository to your local computer.

    git clone https://github.com/eruiz/axebow-first-service.git
  2. Build the service web application and create the container image. By using a multistage build, both the application and the container image are build in only one step.

    Tag the container image using the name and optionally a tag you will use to publish in the container registry.

    # Build command pattern: docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
    #
    # Example: Build to publish in GitHub Packages.
    
    docker build -t ghcr.io/[NAMESPACE]/axebow-first-service:1.0 .

    Replace [NAMESPACE] with the name of the personal account or organization to which you want the package to be scoped.

  3. Publish the container image to the Container registry.

    # Authenticate to the Container registry.
    #
    # Example: If you use GitHub Packages, use a personal access token
    
    echo [GITHUB_TOKEN] | docker login ghcr.io -u [USERNAME] --password-stdin
    
    # Example: Push the container image to the Container registry
    
    docker push ghcr.io/[NAMESPACE]/axebow-first-service:1.0

    Replace [GITHUB_TOKEN] with your personal token. Note, the GITHUB_TOKEN must be granted with: repo, write:packages, read:packages and delete:packages permissions.

About

Nestjs application source code to learn how to deploy it with Axebow, easy and fast (< 2 min).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages