Sign inSign up

heyfworld/notesnook-web

By heyfworld

•Updated about 1 month ago

Image
1

1.4K

heyfworld/notesnook-web repository overview

⁠Notesnook Web

A self-hostable Docker image of the Notesnook⁠ web client, built from the official streetwriters/notesnook⁠ source.

Works out of the box with the official Notesnook cloud — no configuration needed. If you also self-host the Notesnook sync server, simply pass your server URLs as environment variables. No rebuild required.

⁠Quick Start

⁠With official Notesnook cloud (default)
# docker-compose.yml
services:
  notesnook-web:
    image: heyfworld/notesnook-web:latest
    container_name: notesnook-web
    ports:
      - "8080:80"
    restart: unless-stopped
docker compose up -d

Or with docker run:

docker run -d \
  --name notesnook-web \
  --restart unless-stopped \
  -p 8080:80 \
  heyfworld/notesnook-web:latest

Open http://localhost:8080 — done.


⁠With a self-hosted sync server
# docker-compose.yml
services:
  notesnook-web:
    image: heyfworld/notesnook-web:latest
    container_name: notesnook-web
    ports:
      - "8080:80"
    environment:
      NN_API_HOST: https://notesnook-sync.example.com
      NN_AUTH_HOST: https://notesnook-auth.example.com
      NN_SSE_HOST: https://notesnook-events.example.com
      NN_MONOGRAPH_HOST: https://notesnook-mono.example.com
    restart: unless-stopped
docker compose up -d

Or with docker run:

docker run -d \
  --name notesnook-web \
  --restart unless-stopped \
  -p 8080:80 \
  -e NN_API_HOST=https://notesnook-sync.example.com \
  -e NN_AUTH_HOST=https://notesnook-auth.example.com \
  -e NN_SSE_HOST=https://notesnook-events.example.com \
  -e NN_MONOGRAPH_HOST=https://notesnook-mono.example.com \
  heyfworld/notesnook-web:latest

All four environment variables are optional — omit any of them and the image will fall back to the official Notesnook cloud for that service.


⁠Environment Variables

VariableDefaultDescription
NN_API_HOSThttps://api.notesnook.comSync server URL
NN_AUTH_HOSThttps://auth.streetwriters.coAuthentication server URL
NN_SSE_HOSThttps://events.streetwriters.coServer-Sent Events (real-time) URL
NN_MONOGRAPH_HOSThttps://monogr.phMonograph publishing URL

⁠Verify

# Confirm the runtime config was generated with your URLs
docker exec notesnook-web cat /usr/share/nginx/html/config.js

# Check that config.js is served and not cached
curl -sI http://localhost:8080/config.js | grep -i cache-control

# Health check
curl -s http://localhost:8080/health

⁠How It Works

The official Notesnook web app compiles server URLs into the JavaScript bundle at build time using Vite. This image uses a lightweight runtime injection technique to allow URL overrides without rebuilding:

  1. At build time, db.ts is patched to check window.__notesnook_hosts__ before falling back to the compiled defaults.
  2. At container startup, entrypoint.sh runs envsubst to substitute any NN_* environment variables into a config.js template.
  3. config.js is loaded first by index.html (before the app bundle), setting window.__notesnook_hosts__.
  4. nginx serves the app with config.js explicitly set to no-cache so URL changes take effect on the next container restart.

Priority chain:

docker-compose environment: NN_API_HOST
    ↓ (if not set)
https://api.notesnook.com  ← official cloud (built-in default)

⁠Source

Built from streetwriters/notesnook⁠ — the official open-source Notesnook repository.


⁠Notes

  • This image serves only the web client. It does not include the sync server, auth server, or any backend services. For a fully self-hosted setup, refer to the Notesnook self-hosting guide⁠.
  • The source is cloned fresh on each image build, ensuring you always get the latest Notesnook release.

Tag summary

Content type

Image

Digest

sha256:7c251adb9…

Size

49.6 MB

Last updated

about 1 month ago

docker pull heyfworld/notesnook-web