Skip to content

/get-started/docker/

Run it with Docker

The repository’s docker-compose.yaml is a production-like stack: the vola server, its worker, PostgreSQL and Redis, with health checks and named volumes. The server applies its migrations when it starts, and the vola command line is inside the image.

  1. Get the compose file, with the rest of the repository:

    git clone https://github.com/digital-cube/jsvola.git && cd jsvola
  2. Give the database a password:

    echo "POSTGRES_PASSWORD=$(openssl rand -hex 16)" > .env
  3. Build and start it, then wait until the server says it is ready. The first build takes a few minutes:

    docker compose -f docker-compose.yaml up -d --build
    until curl -sf localhost:8300/vola/health/ready; do sleep 2; done
    What it printed
    {"status":"ok","checks":{"database":"ok","redis":"ok"}}
  4. Make a tenant and an API key for it. The key is printed once; only its SHA-256 is stored:

    docker compose -f docker-compose.yaml exec vola vola create-tenant --slug acme --name "Acme Inc"
    docker compose -f docker-compose.yaml exec vola vola create-key --tenant acme --name backend \
    --env live --scopes files:read,files:write,folders:read,folders:write,shares:write
    What it printed
    created tenant acme (Acme Inc) id=01a19fc9
    created key vola_live… "backend" for tenant acme
    id 01a19fc9
    scopes files:read, files:write, folders:read, folders:write, shares:write
    Plaintext key (shown ONCE — store it now, it cannot be recovered):
    vola_live_...
  5. Upload a file to an instance of your application, here a ticket, and read part of it back:

    export KEY=vola_live_... # what create-key printed
    export TICKET=$(uuidgen | tr A-F a-f)
    curl -s -H "Authorization: Bearer $KEY" -F file=@README.md \
    localhost:8300/vola/files/tickets/$TICKET | tee file.json | jq '{filename, size, mime_type, kind}'
    curl -s -o /dev/null -w '%{http_code}\n' -H "Authorization: Bearer $KEY" -H "Range: bytes=0-9" \
    localhost:8300/vola/files/tickets/$TICKET/$(jq -r .id file.json)
    What it printed
    {
    "filename": "README.md",
    "size": 11945,
    "mime_type": "text/markdown",
    "kind": "text"
    }
    206
  6. When you are done, stop it and delete its data:

    docker compose -f docker-compose.yaml down -v

Without Docker or a database service, run it on a SQLite file instead. Running on rootless podman, or behind a reverse proxy? The deployment guide has what changes.

v1.1.0released built 402bea0