-
Notifications
You must be signed in to change notification settings - Fork 1
[WIP] Bk add docusaurus #52
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
base: master
Are you sure you want to change the base?
Conversation
Update siteConfig.js with updated docs folder location.
Remove lerna README.md boilderplate and replace with docusaurus README.md Remove lerna boilerplate in package.json and replace with docusaurus package.json Update package.json with `"name": "unitednepali-documentation"` Now docusaurus files are in the lerna /documentation folder instead of being in the /documentation/website folder.
Delete docusaurus docker-compose.yml file Modify the Dockerfile and docker-compose.yml to use the new folder structure instead of the old website folder.
This doesn't work
This does not work Running documentation through docker via the root docker-compose currently works.
sonalranjit
left a comment
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.
We should probably add a simple cypress test to test the docs endpoint to be running
| - 35729:35729 | ||
| volumes: | ||
| - './packages/documentation:/documentation' | ||
|
|
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.
you should also add a volume mount for ./documentation/node_modules, this is cleaner than copying over the whole folder as you have in the Dockerfile
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.
Are you suggesting
- remove
COPY . /documentationfrom the Dockerfile - remove
./package/documentation:/documentationfrom the docker-compose.yaml and add./documentation/node_modules:/documenation/node_moudlesto the docker-compose.yml - Just add
./documenation/node_modules:/documenation/node_modules
Or some other combination of things
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.
- remove
COPY . /documentation - add
/documentation/node_modules
| - unitednepali-server | ||
|
|
||
|
|
||
| unitednepali-documentation: |
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.
Should include a conatiner name, it'll be easier to understand when debugging, because if you don't give a name docker will assign one, which can be hard to keep track of.
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.
Ohhh that's what that does! Should I add the env_file: docker/.env as well?
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.
nope, docker/.env are just to store environment variables to pass on to the container.
| dockerfile: Dockerfile | ||
| ports: | ||
| - 3009:3000 | ||
| - 35729:35729 |
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.
no point exposing the livereload port because you'll have to rebuild the container, if you made changes to the src files in documentation
| } | ||
|
|
||
| location /docs { | ||
| proxy_pass http://unitednepali-documentation:3000; |
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.
I think you just have to add / after 3000, but you'll probably also have to resolve all the static file urls.
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.
you'll have to update baseUrl in siteConfig.js inside docusaurus to match the forwarding endpoint of /docs. you'll have to update the links for all assets to match the that baseUrl unfortunately 😬
facebook/docusaurus#861
| # Docusaurus uses the top folder (documentation) to find the docs foler | ||
| WORKDIR /documentation | ||
|
|
||
| EXPOSE 3000 35729 |
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.
Don't think we need to expose the live reload port
| # The dockerfile folder has to match the documentation folder name as | ||
| # Docusaurus uses the top folder (documentation) to find the docs foler | ||
| WORKDIR /documentation | ||
|
|
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.
Might have to export your node_modules bin to container's $PATH. see the client container's Dockerfile. I think it's needed to get the docusaurus commands i'm not too sure. try it with a clean. if this works then it's fine.
|
|
Description
Added a new lerna package for documentation with docusaurus. Generally docusaurus creates two folders:
docsandwebsite. I decided to extract everything from thewebsitefolder into the lerna package.This is just the boilerplate stuff that doesn't have actual documentation yet.
We might want to consider putting a top level
docsfolder that is a soft link topackages/documentation/docs. LMK what you think.What's not working
The commits that are marked WIP (Work in Progress) are the commits that aren't working and I need help to fix