Add Dockerfile and compose setup for self-hosting #2

Merged
reudy merged 1 commit from docker into main 2026-09-27 00:35:22 +02:00
Member

Adds a Docker setup for running Papure on a VPS.

What's included

  • Dockerfile: builds the static PWA with Node 24, then serves build/ with nginx.
  • docker/nginx.conf:
    • unknown paths fall back to the app shell,
    • hashed /_app/immutable/ assets are cached for a year,
    • index.html and service-worker.js are no-cache, so updates reach clients,
    • .webmanifest is served as application/manifest+json (nginx's default MIME table lacks it).
  • compose.yaml: one service on port 8080, which PAPURE_PORT can change, with restart: unless-stopped and a health check.
  • .dockerignore: keeps .git, node_modules and the memos/ database out of the build context.
  • A README section on running it.

HTTPS isn't handled inside the container: put a reverse proxy (Caddy, Traefik, nginx) in front, since the PWA install and service worker need HTTPS.

Testing

  • docker compose up -d --build builds, and the container reports healthy.
  • curl: correct status codes, content types and cache headers for /, a deep link, the manifest, the service worker and a hashed JS file.
  • Firefox (Playwright) against the container: the page-size end-to-end test passes and the service worker activates.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VsorPV3JeJRoZ1mD1pdvtL

Adds a Docker setup for running Papure on a VPS. ## What's included - `Dockerfile`: builds the static PWA with Node 24, then serves `build/` with nginx. - `docker/nginx.conf`: - unknown paths fall back to the app shell, - hashed `/_app/immutable/` assets are cached for a year, - `index.html` and `service-worker.js` are `no-cache`, so updates reach clients, - `.webmanifest` is served as `application/manifest+json` (nginx's default MIME table lacks it). - `compose.yaml`: one service on port `8080`, which `PAPURE_PORT` can change, with `restart: unless-stopped` and a health check. - `.dockerignore`: keeps `.git`, `node_modules` and the `memos/` database out of the build context. - A README section on running it. HTTPS isn't handled inside the container: put a reverse proxy (Caddy, Traefik, nginx) in front, since the PWA install and service worker need HTTPS. ## Testing - `docker compose up -d --build` builds, and the container reports healthy. - `curl`: correct status codes, content types and cache headers for `/`, a deep link, the manifest, the service worker and a hashed JS file. - Firefox (Playwright) against the container: the page-size end-to-end test passes and the service worker activates. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VsorPV3JeJRoZ1mD1pdvtL
agent added 1 commit 2026-09-27 00:33:18 +02:00
Multi-stage build: Node builds the static PWA, nginx serves it with an SPA
fallback, long-lived caching for hashed assets, no-cache for the app shell
and service worker, and the correct type for the web manifest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VsorPV3JeJRoZ1mD1pdvtL
reudy approved these changes 2026-09-27 00:35:12 +02:00
reudy merged commit 24ebbd9056 into main 2026-09-27 00:35:22 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: reudy-net/Papure#2
No description provided.