Skip to content

Docker

Run tripplan.ing with Docker using the Node adapter, SQLite, and filesystem storage. This is suitable for self-hosted deployments, testing, or environments without Cloudflare access.

Prerequisites

  • Docker installed
  • Stripe and Mailgun credentials (for payment and email features)

Building the image

bash
docker build -t tripplan-ing .

The Dockerfile uses the Node adapter instead of the Cloudflare adapter, producing a standard Node.js server.

Running the container

bash
docker run --rm -p 3000:3000 \
  -e STRIPE_SECRET_KEY=sk_test_... \
  -e STRIPE_WEBHOOK_SECRET=whsec_... \
  -e MAILGUN_API_KEY=key-... \
  -e MAILGUN_DOMAIN=mg.example.com \
  -e PLATFORM_OPERATOR_EMAILS=admin@example.com \
  -e PLATFORM_DOMAIN_SUFFIX=localhost \
  -v $(pwd)/data:/app/data \
  tripplan-ing

The app starts at http://localhost:3000.

Data persistence

The Node runtime stores data in /app/data inside the container:

PathPurpose
/app/data/local.dbSQLite database
/app/data/objects/Photo and document files

Mount a volume (-v) to persist data across container restarts. Without a volume, data is lost when the container stops.

Environment variables

VariableRequiredDefaultDescription
STRIPE_SECRET_KEYFor paymentsStripe API key
STRIPE_WEBHOOK_SECRETFor paymentsStripe webhook secret
MAILGUN_API_KEYFor emailMailgun API key
MAILGUN_DOMAINFor emailMailgun domain
PLATFORM_OPERATOR_EMAILSYesComma-separated operator emails
PLATFORM_DOMAIN_SUFFIXYesDomain suffix for events
DATABASE_URLNofile:/app/data/local.dbSQLite database path
FILES_DIRNo/app/data/objectsFile storage directory
ENABLE_DEV_BYPASSNofalseSkip auth (development only)

Node runtime differences

The Docker deployment uses the same Node runtime as local development:

FeatureCloudflareDocker/Node
DatabaseD1 (edge SQLite)better-sqlite3 (local file)
SessionsKV (persistent, global)In-memory Map (lost on restart)
File storageR2 (S3-compatible)Filesystem
Auto-migrationNo (CI runs migrations)Yes (on startup)
Demo seed dataNoYes (first run)

Session persistence

The in-memory KV store means sessions are lost on container restart. Users will need to re-authenticate after a restart. For production Docker deployments, consider implementing a persistent KV adapter (e.g., Redis-backed) or accept the restart trade-off.

Auto-migration

The Node runtime automatically applies pending migrations on startup. No need to run a separate migration step before starting the container.

Multi-event routing

For Docker deployments with multiple events, set up hostname routing:

  1. Create events in the platform UI at /platform/events/create
  2. Configure domains in platform_event_domains
  3. Set up a reverse proxy (Nginx, Caddy, Traefik) to route subdomains to the container
  4. Ensure DNS points subdomains to the proxy

For a single-event deployment, the app automatically falls back to the first event when hostname resolution fails.

Health checks

The app responds to standard HTTP requests. Use the homepage as a health check endpoint:

bash
curl http://localhost:3000/

Released under the MIT License.