[WIP] Bk add docusaurus#52
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.
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.
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.
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.
- remove
COPY . /documentation - add
/documentation/node_modules
| - unitednepali-server | ||
|
|
||
|
|
||
| unitednepali-documentation: |
There was a problem hiding this comment.
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.
Ohhh that's what that does! Should I add the env_file: docker/.env as well?
There was a problem hiding this comment.
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.
no point exposing the livereload port because you'll have to rebuild the container, if you made changes to the src files in documentation
| } No newline at end of file | ||
|
|
||
| location /docs { | ||
| proxy_pass http://unitednepali-documentation:3000; |
There was a problem hiding this comment.
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.
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.
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.
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