Skip to content

[COMMS-782] Have Hocuspocus with live code in Docker Compose based dev setup#23972

Open
judithroth wants to merge 7 commits into
devfrom
jr/chore/dev-hocuspocus-from-source
Open

[COMMS-782] Have Hocuspocus with live code in Docker Compose based dev setup#23972
judithroth wants to merge 7 commits into
devfrom
jr/chore/dev-hocuspocus-from-source

Conversation

@judithroth

Copy link
Copy Markdown
Contributor

Ticket

https://community.openproject.org/wp/COMMS-782

What are you trying to accomplish?

Improve development setup for Hocuspocus:

  • Pick up code changes
  • Work with TLS
  • Work out of the box when running docker compose up

What approach did you choose and why?

Finish what Wieland already started and only needed some small tweaks

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)
Copilot AI review requested due to automatic review settings June 26, 2026 13:50
@judithroth judithroth self-assigned this Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Docker Compose-based development setup for the Hocuspocus collaborative editing server by integrating it into the main docker-compose.yml, wiring it into the shared gateway network used by the TLS proxy stack, and updating the Docker development documentation accordingly.

Changes:

  • Document the required externally-managed gateway Docker network and incorporate it into the Docker dev setup steps.
  • Move Hocuspocus into the root docker-compose.yml (including Traefik routing + joining the external gateway network) and make backend depend on it.
  • Adjust bin/compose setup flow (but it currently introduces a duplicated npm install invocation).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/development/development-environment/docker/README.md Adds explicit setup step for the shared external gateway network; updates TLS section accordingly.
docker/dev/hocuspocus/docker-compose.yml Removes the standalone Hocuspocus dev compose stack (now integrated at repo root).
docker/dev/hocuspocus/docker-compose.override.example.yml Removes the old override example for running Hocuspocus with local code (superseded by root compose changes).
docker/dev/hocuspocus/.gitignore Removes ignore entries related to the removed standalone Hocuspocus dev stack.
docker-compose.yml Adds external gateway network + a Hocuspocus service wired for Traefik/TLS and used by backend (and test stack).
bin/compose Updates setup command flow (currently runs frontend npm install twice).
Comment thread docker-compose.yml
wielinde and others added 3 commits June 26, 2026 16:28
Local devs should always exercise the current code of the hocuspocus
extension, not a pre-built image that lags behind. Add a `hocuspocus`
dev service to the main compose file using `node:22-alpine`, bind-mount
`./extensions/op-blocknote-hocuspocus` and run `npm run dev`. Remove the
obsolete `docker/dev/hocuspocus/` directory (image-based override).

`backend` now depends on `hocuspocus`, and `hocuspocus-test` reuses the
same anchor so test and dev paths converge.

Traefik routing for `hocuspocus.local` stays out of the main compose
(matches the convention used for backend/frontend) — devs running TLS
proxy add it to their personal `docker-compose.override.yml`.

Refs: https://community.openproject.org/wp/74654

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Step 1 toward TLS-by-default for dev: declare the `external` network
(joined to the gateway managed by the TLS proxy stack) in the main
compose, and add traefik routing labels for the hocuspocus service so
it's reachable under https://hocuspocus.${OPENPROJECT_DOCKER_DEV_TLD:-local}
out of the box for any contributor running the TLS proxy.

Backend and frontend still keep their traefik labels in personal
overrides; they'll follow in a later step.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PR 1 now declares the `gateway` network as `external: true` in the main
docker-compose.yml and joins hocuspocus to it for TLS-by-default routing.
Compose refuses to start if that network isn't pre-created.

Surface `docker network create gateway` in both the Quick start block and
as its own numbered step in the Step-by-step Setup. The TLS support section
no longer needs to duplicate the create-network step.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@judithroth judithroth force-pushed the jr/chore/dev-hocuspocus-from-source branch from 6678c50 to f9cfff1 Compare June 26, 2026 14:28
https://community.openproject.org/wp/COMMS-782

Like installing e.g. the frontend, this should also "automatically"
happen since Hocuspocus now is part of OpenProject.
https://community.openproject.org/wp/COMMS-782

The port needs to be explicitly mentioned here since the container does
not expose it (and therefore traefik can not know it otherwise)
@judithroth judithroth force-pushed the jr/chore/dev-hocuspocus-from-source branch from f9cfff1 to fa10cad Compare June 26, 2026 14:31
@judithroth judithroth requested review from a team and NobodysNightmare and removed request for a team and NobodysNightmare June 30, 2026 14:23
@judithroth judithroth marked this pull request as draft June 30, 2026 14:40
@judithroth judithroth force-pushed the jr/chore/dev-hocuspocus-from-source branch from f2b020a to 38a8e38 Compare June 30, 2026 15:31
@judithroth judithroth marked this pull request as ready for review June 30, 2026 16:41
@judithroth judithroth requested review from a team and NobodysNightmare June 30, 2026 16:41
Comment thread docker-compose.yml
- "traefik.enable=true"
- "traefik.http.routers.hocuspocus.rule=Host(`hocuspocus.${OPENPROJECT_DOCKER_DEV_TLD:-local}`)"
- "traefik.http.routers.hocuspocus.entrypoints=websecure"
- "traefik.http.services.hocuspocus.loadbalancer.server.port=1234"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port needs to be set because it is not exported by default, therefore traefik can not pick it up automatically.

docker network create gateway
# The `gateway` network is already created as part of the base setup
# (see "Step-by-step Setup → 3) Create the shared `gateway` network").
# If you skipped that step, create it now: `docker network create gateway`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I already commented on the original PR that I find it confusing to mention in step 5, that you should please run step 3.

Comment thread docker-compose.yml
image: node:22-alpine
restart: unless-stopped
environment:
- SECRET=${OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET:-secret12345}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this secret should also be set for the x-op-backend: &backend block under environment, so that a docker-hosted OpenProject also receives the same secret.

Right now, I can't connect to the thing:

Image
@NobodysNightmare

NobodysNightmare commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

I just realized that running the new npm install command in the Hocuspocus container creates a diff for me:

diff --git a/extensions/op-blocknote-hocuspocus/package-lock.json b/extensions/op-blocknote-hocuspocus/package-lock.json
index 68c61144710..e5fa02a1956 100644
--- a/extensions/op-blocknote-hocuspocus/package-lock.json
+++ b/extensions/op-blocknote-hocuspocus/package-lock.json
@@ -1383,9 +1383,6 @@
         "arm64"
       ],
       "dev": true,
-      "libc": [
-        "glibc"
-      ],
       "license": "MIT",
       "optional": true,
       "os": [

(lots more occurences that remove libc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants