App Configuration
Section titled “App Configuration”The sherpa.sh platform supports many different types of frameworks using the same simple settings. Below are the most common settings you need to set to deploy your web app.
Default Domain
Section titled “Default Domain”This is the domain where you're application will be reachable by your users. It is fully customizable.
By default, your web app will be assigned a subdomain under sherpa.software. This is the address where users can access your application. For example, if your app is named "myapp," it will default to myapp.sherpa.software.
You can always change this domain to suit your preferences, or use a custom domain.
Build Settings
Section titled “Build Settings”There are different build settings depending on what type of app you are building:
Javascript Applications
Section titled “Javascript Applications”The commands that are run when building the production version of your app. Typically, these are the install and build commands in your package.jsonfile.
You can use the following support package managers:
- npm
- pnpm
- yarn
- bun
Need something else? Let us know.
Framework
Section titled “Framework”Select your projects framework. When your app is deployed we use your framework's best practices to optimize the infrastructure for your application. This means we setup all the appropriate cache-headers, distributed caching, and scaling algorithms to ensure a fast, delightful, and personalized customer experience.
If the framework you need is not listed or supported, let us know, we'll add it faster than you think!
Install Command
Section titled “Install Command”How you install your node modules and packages. Typically this is a command from your package.json. For example: npm i.
Build Command
Section titled “Build Command”How you build your project. Like npm run build. We set NODE_ENV=production by default for all builds of javascript applications. You can override this with environment variables.
Output Directory
Section titled “Output Directory”The path where your build command outputs the built files Usually you want to leave this as the default value.
If you run into trouble, open a chat with us and we'll be happy to help you get setup.
Static Generation Only
Section titled “Static Generation Only”When this is toggled on, Sherpa.sh will build and deploy your project using SSG (Static Site Generation). You must ensure that your project is configured appropriately, and the correct output directory is set for your deployment.
Docker Applications
Section titled “Docker Applications”Docker Settings
Section titled “Docker Settings”Two different settings are essential for Docker applications:
- Dockerfile: The name of the Dockerfile to build your application. If your docker file is not named
Dockerfilethis is where you put that value. - Port: The port that your application exposes. Set the value of the exposed port that the application listens to in the container. This can only be one port. If you have multiple services that run on different ports please put them in separate containers. If they are in the same repo, you can import the repository twice and set different Dockerfile settings.
Root Directory
Section titled “Root Directory”Sometimes your application will be in a sub-directory of your repo. Set this value to the directory path of your application in your repo. For example if you have a NextJS app inside of your repo in the path root > projects > mynextapp , in the root directory setting you would put the value projects/mynextapp.
All Build Setting commands will run inside this folder.
Environment Variables
Section titled “Environment Variables”Environment variables are key-value pairs accessible via process.env in your Node.js application, both during build and runtime.
Processing Conventions
Section titled “Processing Conventions”Our platform processes environment variables through a specific pipeline:
- Adding Variables: Environment variables added in the gui (including pasting
.envfiles) are parsed into JSON using dotenv and saved securely in the Sherpa.sh infrastructure. - Building Process Access to Variables: At build time, variables are written to a file in your build directory called
.env.localand loaded into the bash environment along with any other.envfiles in your repo via dotenvx (See resolution order below for variables resolution with multiple .env files). Additionally,NODE_ENVdefaults toproductionunless explicitly set. - Application Access to Variables: At deployment time, the environment variables JSON is converted to YAML via js-yaml and injected into the Docker container environment. These env variables are available in the OS for your backend application. Additionally, the
.env.localfile written during the build process will ensure all environment variables are available in theprocess.envof your application (based on your frameworks conventions for injecting variables intoprocess.envthese will be avaiable in both the frontend and backend)
Resolution Order
Section titled “Resolution Order”Standard Projects (Non-Next.js)
Section titled “Standard Projects (Non-Next.js)”Following dotenv-flow conventions, files are loaded in priority order:
.env.{NODE_ENV}.local(e.g.,.env.production.local).env.local(ignored whenNODE_ENV=test) *Added by Sherpa.sh with your env vars..env.{NODE_ENV}(e.g.,.env.production).env
Next.js Projects
Section titled “Next.js Projects”Following Next.js conventions:
process.env.env.$(NODE_ENV).local.env.local(not loaded whenNODE_ENV=test) *Added by Sherpa.sh with your env vars..env.$(NODE_ENV).env
Formatting
Section titled “Formatting”Special Characters
Section titled “Special Characters”Based on dotenv parsing behavior, here's how special characters are interpreted and made available to process.env:
| Character/Pattern | Input | process.env output | Notes |
|---|---|---|---|
| Newlines | "Line1\nLine2" | Line1\nLine2 | \n becomes actual newline |
| Escaped newlines | "Line1\\nLine2" | Line1\\nLine2 | \\n preserved as literal |
| Carriage returns | "Line1\r\nLine2" | Line1\r\nLine2 | Windows line endings preserved |
| Quotes in values | "This is \"quoted\"" | This is \"quoted\" | Escape sequences preserved |
| Dollar signs | '$HOME won't expand' | $HOME won't expand | Single quotes prevent expansion |
| Backslashes | "C:\path\to\file" | C:\path\to\file | Single backslash preserved |
| Double backslashes | "C:\\path" | C:\\path | Literal backslashes |
| Special escapes | "\t \r \n" | Tab, CR, LF characters | Escape sequences interpreted |
| Multiline actual |
| Line1\nLine2 | Actual line breaks become \n |
| Comments | value # comment | value | Comments stripped |
| Leading/trailing spaces | ` value ` | value | Spaces trimmed unless quoted |
Valid Keys
Section titled “Valid Keys”Environment variables must be compatible with Kubernetes naming conventions since they're deployed to Docker containers. Keys are validated against the pattern: [-._a-zA-Z][-._a-zA-Z0-9]*
Filtered Keys (automatically removed):
- Starting with numbers:
123KEY,1_VARIABLE - Containing spaces:
MY KEY,VARIABLE NAME - Special characters:
KEY@EMAIL,KEY#HASH,KEY$DOLLAR,KEY-WITH-DASH - Dots in names:
KEY.WITH.DOT,app.config.value
Valid Keys:
- Alphanumeric with underscores:
API_KEY,DATABASE_URL,PORT_3000 - Starting with letters:
MY_VAR,abc123 - Starting with underscore:
_PRIVATE,__INTERNAL__ - Mixed case:
MyVariable,camelCase
App Region
Section titled “App Region”When configuring your app region, you can choose from three options:
- US East (N. Virginia),
- US West (N. California)
- EU Central (Frankfurt, Germany).
This selection determines where your application will run. You want to select the location closest to your database(s) to minimize latency to and from your data.
For more information, see our regions documentation.
NodeJS Version
Section titled “NodeJS Version”The version of Node to use for the build process and for running your application.
Branch Settings
Section titled “Branch Settings”Configure how continuous delivery works on your application.
The selected branch will be the production branch, meaning any new commit on that branch will trigger a build and deployment to your Default Domain.
A build and deployment to a preview environment will also be triggered when a new pull request is opened for a different branch. New commits on branches with open pull requests will also trigger a new build and deployment to a preview environment. You can disable automatic deployments of preview branches by disabling auto branch deployments.