-
Notifications
You must be signed in to change notification settings - Fork 3
CoLab YJS
This page will guide you through running CoLab-YJS in a docker container, avoiding having to manually start it when running CoLab locally.
You may have to change the AUTHHOST and DBHOST ports corresponding to your Payara and Mongo instances. By default Payara should be running on port 8080 and Mongo on port 27017.
From Colab root open the CoLab-YJS Dockerfile :
/colab-api/src/main/node/colab-yjs/Dockerfile
ENV AUTHHOST="http://host.docker.internal:<YOUR_PORT_HERE>/"
ENV DBHOST="mongodb://host.docker.internal:<YOUR_PORT_HERE>/colablexical"
- From Colab root navigate to :
/colab-api/src/main/node/colab-yjs - Build image from Dockerfile by running :
docker build -t colab-yjs . - Start a container from the image by running :
docker run --name CoLab-YJS -dp 127.0.0.1:4321:4321 --restart always colab-yjs
Your CoLab-YJS instance should now be running and exposed on port 4321 (default port but you can change it if needed).
From CoLab root open the colab.properties file :
/colab-webapp/colab.properties
Here make sure to add the URL for your CoLab-YJS instance, for example running on port 4321: colab.yjs.url=ws://localhost:4321
We heavily recommend you index your YJS collection in MongoDB by adding a compound index as follows :
db['your-collection'].createIndex({ docName: 1, value: 1, version: 1, });