The container bundles NW.js and app files inside the image. You only need Docker on the host; no Node, no npm, no global NW.js.
Default NW.js version: 0.109.1 (same family as package.json / ./bin/visual-page-editor). Override at build time with --build-arg NWJS_VERSION=….
From the repository root:
./docker-run.sh examples/lorem.xmlThe first run builds an image tagged visual-page-editor:<version> where <version> comes from the VERSION file (for example visual-page-editor:1.2.0). The script also tags visual-page-editor:latest for convenience.
-
Rebuild after pulling git changes or changing
VERSION:
./docker-run.sh --build examples/lorem.xml -
Help:
./docker-run.sh --help
| Host | What you need |
|---|---|
| macOS | Docker Desktop and XQuartz. XQuartz → Settings → Security → Allow connections from network clients, then quit and reopen XQuartz. docker-run.sh sets DISPLAY=host.docker.internal:0. |
| Linux | Docker Engine + local X11. docker-run.sh uses DISPLAY=:0 and xhost +local:docker (or set DISPLAY yourself). Mounting /tmp/.X11-unix is handled by the script. |
| Headless | Omit GUI: run the image without a usable DISPLAY; the entrypoint starts Xvfb on :99 so the process still runs (no visible window). |
For teams that prefer Compose:
- Copy env template:
cp .env.docker.example .env - Set
DISPLAYin.envfor your OS (see comments in.env.docker.example). - Optionally set
VPE_VERSIONto matchVERSIONso the image name matches releases. - Build and run:
docker compose build
docker compose run --rm visual-page-editor examples/lorem.xmlnetwork_mode: host is not used so the same file works on Docker Desktop (macOS/Windows) and Linux.
Pin the app version label and image tag to match VERSION:
V="$(tr -d '\n' < VERSION)"
docker build --platform linux/amd64 \
--build-arg NWJS_VERSION=0.94.0 \
--build-arg APP_VERSION="$V" \
-f Dockerfile.desktop -t "visual-page-editor:${V}" .Run (Linux X11 example):
xhost +local:docker
docker run --rm -it --platform linux/amd64 \
-e DISPLAY=:0 \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-v "$HOME/.Xauthority:/root/.Xauthority:rw" \
-v "$(pwd):/workspace:rw" \
-v "$(pwd)/examples:/app/examples:ro" \
"visual-page-editor:${V}" examples/lorem.xmlmacOS + XQuartz: use -e DISPLAY=host.docker.internal:0 and omit the /tmp/.X11-unix mount (see ./docker-run.sh).
- Platform: Images are linux/amd64 NW.js. On Apple Silicon, Docker runs them via emulation; that is expected and keeps one image for everyone.
- Reproducible tags: Prefer
visual-page-editor:<VERSION>over:latestwhen reporting bugs or deploying. - Data: The repo is mounted at
/workspace; saves from the app go to your host working tree.examplesis mounted read-only at/app/examplesso paths likeexamples/lorem.xmlresolve withWORKDIR/app.
| Issue | What to try |
|---|---|
| Cannot connect to X server | macOS: XQuartz running + network clients enabled. Linux: echo $DISPLAY, xhost +local:docker, X server running. |
| Rebuild after upgrade | ./docker-run.sh --build … or docker compose build --no-cache |
| Wrong / old NW.js | Rebuild with explicit --build-arg NWJS_VERSION=0.109.1 |
Application logs inside the container go to stderr; NW.js/Chromium messages appear in the terminal you used for docker run.