Skip to content

Latest commit

 

History

History
174 lines (118 loc) · 5.1 KB

getting-started.md

File metadata and controls

174 lines (118 loc) · 5.1 KB

Getting Started

With DropStack, you can deploy and publish any kind of web app (or service) in under five minutes. This guide includes information about:

 

Five Minutes Guide


DropStack CLI

If you've already installed Node.js, you can run the following command to install the CLI:

$ npm install -g dropstack-cli

For more information on DropStack CLI, run the help command with:

$ dropstack help

Login to DropStack

When the installation is completed, you can log in to DropStack by running the following command using a terminal:

$ dropstack login

Follow the instructions on the screen. (Since this is your first time, it will create an account for you.)

Deploy a static web app

Let's deploy a simple static web app. Create a directory called my-web-app and add the following content to a file called index.html.

<!DOCTYPE html>
<html>
  <head>
    <title>My Web App</title>
  <body>
    This is a static web app.
  </body>
</html>

You can also use a Node.js app or an app with a Dockerfile instead of this simple static app.

After you have added the content, visit the my-web-app directory using a terminal and run this command:

$ dropstack deploy

DropStack will deploy the app and give you a URL as shown below.

Mapping a custom domain name

You have a unique URL (https://avvuiuuwto.cloud.dropstack.run) for your app right now. But you probably want a nicer-sounding URL before directing your users there. The next step is to map the "cloud.dropstack.run" URL to a domain name that you prefer. Let's assume the domain name is my-web-app.com, and you haven't bought it yet. To map this domain name to the app's unique URL, run this command:

$ dropstack domain avvuiuuwto -url my-web-app.com

Update the app

If you've made any changes to your app, you will need to deploy the latest version of your app. To do that, run this command:

$ dropstack deploy

 

Deployments


With DropStack, you can deploy any kind of web app by using a single command. DropStack supports three types of deployments:

  • Static - for static web apps
  • Node.js - for Node.js apps
  • Docker - for all other apps

We have special categories for static and Node.js deployments because they are the most common among the deployments we handle. But you can also use Docker to deploy static and Node.js apps. Here is how each of these deployments work:

For more information on DropStack deploy, run the help command with:

$ dropstack help deploy

 

Logs


Logs are important because it allows you to see what's happening inside the app, especially when a crisis happens. DropStack keeps logs of all of your deployments and allows you to search them.

Let's have a look at how you can access logs.

Via CLI

Accessing logs via the DropStack CLI is simple as invoking this command:

$ dropstack logs avvuiuuwto

For more information on DropStack logs, run the help command with:

$ dropstack help logs

Via Dashboard (Beta)

You can also access and search logs via your web dashboard at https://dashboard.cloud.dropstack.run. Click any of your deployment URLs inside the dashboard and start searching logs. You may need to click the "Logs" link on the header (top right) to see logs.

 

Environment Variables


Almost every app needs to get configurations at runtime. These configurations could be anything, including:

  • Database connection details
  • Third-party API keys
  • Different customization parameters

The best way to expose these configurations is to do so with environment variables, which is a universally available method that works across various programming languages, operating systems and hosting providers. Exposing environment variables with DropStack is easy.

Via CLI

You can expose environment variables with the -v flag.

dropstack deploy -v MONGO_URL="user:password@mydb.com" -e MY_API_TOKEN="XXXXX"

You can then access them inside your app. If your app is a Node.js app, here's how you can do that:

const { MONGO_URL, MY_API_TOKEN } = process.env

Via “.dropstack.json”

You can also expose these environment variables with .dropstack.json. For that, create a file named .dropstack.json inside your app root and add environment variables like this:

{
  "env": {
    "MONGO_URL": "user:password@mydb.com",
    "MY_API_TOKEN": "XXXXX"
  }
}

After that, DropStack will use above environment variables when you deploy your app.



These are just a few things you can do with DropStack. To learn more about DropStack, simply follow the rest of the docs.