I am trying to create docker image of this official public repo of keystonejs https://github.com/keystonejs/keystone
But it contains lot of packages inside it and each package contains package.json inside it, it is some short of multi-module project.
the package.json is present in root directory as well as in sub directory.
how can we create docker image containing all these packages ? if anyone has worked on keystonejs please help me on this ?
thank you
The Keystone codebase is indeed "some sort of multi-module project" – it's what's called a monorepo.
Generally, the term "monorepo" refers to a collection of source code from different projects, stored together in a single repository, inside a version control system (like
git
for example). They're fairly common for large projects:In the NodeJS ecosystem "monorepo" often refers to a repo that includes code for multiple npm packages.
In Keystone case, the main repo includes several npm packages (in the packages dir), a bunch of tests, the Keystone marketing and docs websites (in docs), and various other bits and pieces.
Thinkmill, the team that builds Keystone, has a guide on the monorepo patterns and tools they use. A Google search will give you plenty of other takes; it's a popular topic.
If you want to deploy a Keystone app using docker you don't need to mess with the Keystone repo itself. You just want to install Keystone as a dependency, like any other npm package. The steps are basically:
@keystone-6/core
) in as a dependancy, then..dockerfile
that builds and runs the appGetting a Keystone project running is actually super easy – it only take a few files. There's even a tool called
create-keystone-app
that sets them up for you. I'd suggest running thought the Getting Started guide to get a simple app running locally, then write yourdockerfile
there.