boxlang-digitalocean-app
BoxLang on DigitalOcean App Platform
Overview
DigitalOcean App Platform supports BoxLang applications via a containerized starter kit. The starter uses BoxLang MiniServer inside a multi-stage Docker build and auto-deploys from GitHub on every push to main.
Quick Start
1. Get the Starter Kit
https://github.com/ortus-boxlang/boxlang-starter-digitalocean
Fork or clone the repository:
git clone https://github.com/ortus-boxlang/boxlang-starter-digitalocean.git myapp
cd myapp
2. One-Click Deploy
Use the "Deploy to DigitalOcean" button in the starter kit README to create the App Platform app automatically.
3. Connect Your Fork
In the DigitalOcean App Platform dashboard:
- Create a new App
- Connect your forked GitHub repository
- Select the
mainbranch - App Platform detects the Dockerfile and builds automatically
Every push to main triggers a new deployment (2–3 minutes build time).
Architecture
The starter uses a multi-stage Docker build:
# Stage 1: Build dependencies
FROM ortussolutions/boxlang:latest AS builder
WORKDIR /app
COPY . .
RUN box install --production
# Stage 2: Runtime image
FROM ortussolutions/boxlang:miniserver
WORKDIR /app
COPY /app /app
EXPOSE 8080
CMD ["boxlang-miniserver", "--port", "8080", "--webroot", "/app/www"]
| Component | Technology |
|---|---|
| Web server | BoxLang MiniServer (Undertow) |
| Build | Multi-stage Docker |
| Platform | DigitalOcean App Platform |
| Port | 8080 (App Platform maps to 443/80) |
| Build time | 2–3 minutes |
Environment Variables
Configure your app in the DigitalOcean dashboard under Settings → Environment Variables:
DATABASE_URL=...
API_KEY=...
BOXLANG_DEBUG=false
Access in BoxLang with getSystemSetting():
var dbUrl = getSystemSetting( "DATABASE_URL" )
var apiKey = getSystemSetting( "API_KEY" )
Auto-Deploy Workflow
1. Fork starter → connect to App Platform
2. Develop locally with: boxlang-miniserver --port 8080 --webroot ./www
3. Push to main → App Platform builds + deploys automatically
4. Monitor build logs in the DigitalOcean dashboard
Local Development
# Install BoxLang MiniServer
# (see miniserver skill)
# Run locally using the same config as production
boxlang-miniserver --port 8080 --webroot ./www
# Or with Docker (mirrors production exactly)
docker build -t myapp .
docker run -p 8080:8080 myapp
Checklist
- Fork
boxlang-starter-digitalocean(don't clone into a new repo — fork to keep deploy button working) - Connect GitHub fork to DigitalOcean App Platform
- Set environment variables in App Platform dashboard (not in source code)
- Use
getSystemSetting("KEY")for environment variable access in BoxLang code - Test locally with
boxlang-miniserverbefore pushing to trigger a deploy - Check build logs in App Platform if deployment fails (builds take 2–3 min)
More from ortus-boxlang/skills
boxlang-functional-programming
Use this skill when working with BoxLang lambdas, closures, arrow functions, higher-order functions, functional array/struct pipelines (map, filter, reduce, flatMap, groupBy, etc.), destructuring, or spread syntax.
10boxlang-code-reviewer
Use this skill when reviewing BoxLang code for quality, correctness, security vulnerabilities, performance issues, style violations, or when providing structured code review feedback following BoxLang best practices and security guidelines.
9boxlang-best-practices
Use this skill when writing, reviewing, or improving BoxLang code to ensure it follows community best practices for naming, structure, scoping, error handling, performance, and maintainability.
9boxlang-classes-and-oop
Use this skill when writing BoxLang classes, components, interfaces, inheritance hierarchies, annotations, properties, constructors, or applying object-oriented design patterns in BoxLang.
9boxlang-web-development
Use this skill when building BoxLang web applications: Application.bx lifecycle, request/response handling, sessions, forms, REST APIs, HTTP clients, routing, CSRF protection, Server-Sent Events, or configuring CommandBox/MiniServer.
8boxlang-configuration
Use this skill when configuring BoxLang runtime settings via boxlang.json, setting environment variables for config overrides, configuring datasources, caches, executors, modules, logging, security, or schedulers — or when helping someone understand the BoxLang configuration system.
8