clojure -T:build clean && clojure -T:build uber
For systemd, nginx, Fly.io and Render — with the reference configs from
resources/deploy/ — see Deployment Patterns.
clojure -T:build clean && clojure -T:build uber
This produces target/wagoe-*.jar.
export JWT_SECRET="your-production-secret-min-32-chars"
export WAG_ENV="production"
export POSTGRES_HOST="db.example.com" POSTGRES_DB="myapp" POSTGRES_USER="myapp"
export POSTGRES_PASSWORD="..."
java -jar target/wagoe-*.jar server
| Variable | Required | Description |
|---|---|---|
| Yes | Minimum 32 characters. Used for signing JWT tokens. |
| Yes |
|
| Production | PostgreSQL connection. |
| Production, unless | The prod profile reports errors to Sentry and refuses to boot without a DSN. |
| When using Redis | Redis connection. |
clojure -M:migrate up
Run migrations before starting the server in production; the prod profile does not migrate on start, and the jar has no migrate command.
wagoe new writes a Dockerfile:
docker build -t my-wagoe-app .
docker run -e JWT_SECRET="..." -e WAG_ENV=production -p 3000:3000 my-wagoe-app
Aero reads from resources/conf/{WAG_ENV}/config.edn.
The production config uses environment variables for all secrets:
;; resources/conf/prod/config.edn
:wagoe/postgresql
{:host #env "POSTGRES_HOST"
:port #long #or [#env "POSTGRES_PORT" 5432]
:dbname #env "POSTGRES_DB"
:user #env "POSTGRES_USER"
:password #env "POSTGRES_PASSWORD"}
JWT_SECRET is read from the environment directly, not from the config.
To read secrets that Docker or Kubernetes mount as files, use #secret:
#secret [:file "db-password"] reads /run/secrets/db-password. See
config for the sources and how to add one.
Wagoe supports PostgreSQL, SQLite and MySQL 8, and H2 for tests. Switch a
generated app with bb setup --database mysql.
| Environment | Database |
|---|---|
Development | SQLite (zero config) |
Tests | H2 in-memory |
Staging / Production | PostgreSQL (recommended) |
PostgreSQL is required for multi-tenancy (wagoe-tenant). Search (wagoe-search) uses
PostgreSQL full-text search there and a LIKE match elsewhere.
On SQLite, MySQL 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:
thijscreemers & Thijs CreemersEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |