Liking cljdoc? Tell your friends :D

Deployment

For systemd, nginx, Fly.io and Render — with the reference configs from resources/deploy/ — see Deployment Patterns.

Build an uberjar

clojure -T:build clean && clojure -T:build uber

This produces target/wagoe-*.jar.

Run the server

export JWT_SECRET="your-production-secret-min-32-chars"
export WAG_ENV="production"
export DB_URL="jdbc:postgresql://host:5432/myapp"
export DB_PASSWORD="..."

java -jar target/wagoe-*.jar server

Environment variables

VariableRequiredDescription

JWT_SECRET

Yes

Minimum 32 characters. Used for signing JWT tokens.

WAG_ENV

Yes

development, test, acc, or production.

DB_URL

Production

JDBC connection string.

DB_PASSWORD

Production

Database password.

REDIS_URL

When using cache/jobs

Redis connection URL.

Database migrations

clojure -M:migrate up

Run migrations before starting the server in production.

Docker

A Dockerfile is included in the starter:

docker build -t my-wagoe-app .
docker run -e JWT_SECRET="..." -e WAG_ENV=production -p 3000:3000 my-wagoe-app

Configuration per environment

Aero reads from resources/conf/{WAG_ENV}/config.edn. The production config uses environment variables for all secrets:

;; resources/conf/prod/config.edn
:wagoe/db
{:url      #env DB_URL
 :password #env DB_PASSWORD
 :pool-size 20}

:wagoe/jwt
{:secret #env JWT_SECRET}

Database recommendations

Wagoe 1.0 supports PostgreSQL and SQLite, and H2 for tests. MySQL is not supported yet: it is planned after 1.0.

EnvironmentDatabase

Development

SQLite (zero config)

Tests

H2 in-memory

Staging / Production

PostgreSQL (recommended)

PostgreSQL is required for multi-tenancy (wagoe-tenant) and full-text search (wagoe-search). On SQLite or H2, an application with :wagoe/tenant in its config refuses to boot; a test profile on H2 sets :allow-h2? true under :wagoe/tenant.

Can you improve this documentation? These fine people already did:
Thijs Creemers & thijscreemers
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close