-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: docker compose for entire stack #20
Conversation
… self-contained y-websocket is left in root package.json as devDependencies because it's needed for the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This is a great addition!
I felt motivated to work on my own docker-compose file at the same time -.-
I don't feel attacked to my approach. However, I'd like to keep it as simple as possible. Can you please refactor and rebase?
Feel free to do everything in a single PR. I won't touch the docker files and the package*.json files for a few days anyway.
shared: &shared | ||
env_file: .env | ||
# overrides to connect services inside of Docker overlay network | ||
environment: &shared-env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea!
If the compose file overrides the configurations, then we only need to generate the auth tokens in .env
# | ||
# demo apps | ||
# | ||
demo-codemirror: &demo-authexpress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we could keep the main compose file small. IMHO it would be better to move the compose file to the demos and inherit from the main compose file, like I'm currently doing.
@@ -0,0 +1,7 @@ | |||
FROM node | |||
|
|||
WORKDIR /app/demo/auth-express |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename this to app/demo/auth-express
Ok, I'll resubmit as part of a new PR rebased on the latest master in a few days. |
I had a few questions: Core vs demoHow to see the separation between 'core' and 'demo' stuff - currently there's a Packagizing?Perhaps it would make sense to make a monorepo with each of the services as packages, and some of them being demos? E.g., (also trying to make names a bit longer/expressive - but I see it'd be nice to keep them short too): workspaces: ["apps/*", "packages/*"]
# core, and perhaps published as npm packages:
apps/yr-sync (server)
apps/yr-compactor (worker)
packages/yr-utils
# not core:
apps/ex-yr-auth-server
apps/ex-yr-backup-server
apps/ex-demo-codemirror
apps/ex-demo-blocksuite The parts that need to be customizable in the core services could be made customizable through hooks/callbacks/configs. APIs for storageThere seems to be several ways to provide storage for yjs docs, which is good but also a bit confusing:
It would perhaps be useful to map out what the generalized storage APIs need to be, and to provide an API to implement to - do we need one for connecting into ydocs directly and one for the functionality that y-redis requires? |
The The I want to fill the
Maybe eventually. For now, this should be fine. I use the same structure in all my projects and I like to keep it simple. There are definitely different flavors of simple. At least this approach is consistent with my other projects.
The advantage of y-redis over other implementations is that it doesn't keep the Yjs document in-memory. Hence, you can't use the other providers in y-redis. If you want to use y-redis, you should definitely implement You can use any other persistence provider on the client. |
Provide a compose.yml for the entire stack: