Liking cljdoc? Tell your friends :D

Deployment

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

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).

Can you improve this documentation?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