Levelrail
Skip to content

Self-host Static Site + API Backend with Docker ​

A static frontend and a separate API service deployed together, the split most SPAs actually run.

This page describes the Levelrail template for Static Site + API Backend (Starter Kits). It deploys the services below as one Docker Compose app on your own server.

Project site: https://nginx.org/en/docs/.

Recommended memory: about 128 MiB.

Services, ports and volumes ​

ServiceImageContainer portsVolumes
apinode:22-alpine4000none
staticnginx:1.27-alpine80none

Environment variables ​

ServiceVariableValue
apiNODE_ENVPreset in the template

Passwords and keys marked as generated are created for you when the app is deployed and stored as secrets. Values are not shown here.

Deploy Static Site + API Backend with Levelrail ​

In the dashboard, open Apps, choose New app, then Browse templates, and select Static Site + API Backend. Review the Compose body and deploy.

With the CLI:

levelrail-cli templates deploy static-site-api-starter --name my-static-site-api-starter

See Service template catalog for how templates work, and Getting started if you have not installed Levelrail yet.

More Starter Kits templates ​

All templates are listed in the self-host gallery.

Released under the Apache 2.0 License.