[COMMS-782] Have Hocuspocus with live code in Docker Compose based dev setup#23972
[COMMS-782] Have Hocuspocus with live code in Docker Compose based dev setup#23972judithroth wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
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
gatewayDocker network and incorporate it into the Docker dev setup steps. - Move Hocuspocus into the root
docker-compose.yml(including Traefik routing + joining the externalgatewaynetwork) and make backend depend on it. - Adjust
bin/composesetup flow (but it currently introduces a duplicatednpm installinvocation).
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). |
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>
6678c50 to
f9cfff1
Compare
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)
f9cfff1 to
fa10cad
Compare
f2b020a to
38a8e38
Compare
| - "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" |
There was a problem hiding this comment.
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`. |
There was a problem hiding this comment.
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.
| image: node:22-alpine | ||
| restart: unless-stopped | ||
| environment: | ||
| - SECRET=${OPENPROJECT_COLLABORATIVE__EDITING__HOCUSPOCUS__SECRET:-secret12345} |
|
I just realized that running the new 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 |

Ticket
https://community.openproject.org/wp/COMMS-782
What are you trying to accomplish?
Improve development setup for Hocuspocus:
docker compose upWhat approach did you choose and why?
Finish what Wieland already started and only needed some small tweaks
Merge checklist