Docker Compose

Storsko Core ships with a docker-compose.yml for running the full stack locally or in production.

Docker Compose

Storsko Core ships with a docker-compose.yml for running the full stack locally or in production.

Services

ServicePortDescription
postgres5432PostgreSQL 16 — primary database
api-server3000Storsko Core REST API
web3001Next.js web dashboard

Quick start

cd storsko-core
cp .env.example .env
make setup
make dev-infra   # starts postgres
make dev         # starts api-server + web

Environment variables

Copy .env.example to .env and set:

POSTGRES_PASSWORD=changeme_local
ROOT_API_KEY=storsko_root_<64 random hex chars>
JWT_SECRET=<at least 32 random chars>
DATABASE_URL=postgres://storsko:changeme_local@localhost:5432/storsko

Generate a root key:

node -e "console.log('storsko_root_' + require('crypto').randomBytes(32).toString('hex'))"

Running migrations

make migrate

This applies all pending SQL migrations from packages/api-server/migrations/.

Health check

curl http://localhost:3000/health
# {"status":"ok"}

Custom compose override

Create docker-compose.override.yml to extend the base compose without modifying the checked-in file:

services:
  api-server:
    environment:
      LOG_LEVEL: debug