Git Product home page Git Product logo

docker-docusaurus's Introduction

💁 I, am

  • NestJS backend developer
  • Previously Linux system engineer
  • Hobbyist AOSP developer
  • Loving open source projects
  • Want to learn sleek frontend technique
  • Watching single-board computer products
  • Tiny contributor doing it on demand

🤔 Thinking these days,

... have to dig in something as much as the other people do.

🙈 My Github stats

💻 Currently doing something with,

👀 Profile view counter

docker-docusaurus's People

Contributors

amarzial avatar awesometic avatar stoneyjackson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docker-docusaurus's Issues

Not able to run documented steps to generate a new site

I'm trying to run this following the instructions. It fails for me as shown below. My example I'm not mounting the volume, but it failed the same way. Am I missing something simple?

docker run -it --rm awesometic/docusaurus 
Variables:
	- UID=1000
	- GID=1000
	- AUTO_UPDATE=true
	- WEBSITE_NAME=MyWebsite
	- TEMPLATE=classic
	- RUN_MODE=development
/* Register a new cron job for auto updating... */
/* Successfully registered. */
/* Install docusaurus... */
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @docusaurus/init@next.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-11-24T21_37_46_824Z-debug.log
Install for [ '@docusaurus/init@next' ] failed with code 1
/* Installing node modules... */
/init.sh: line 54: cd: /docusaurus/MyWebsite: No such file or directory
yarn install v1.22.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 0.10s.
/* Start supervisord to start Docusaurus... */
2020-11-24 21:37:47,490 INFO Set uid to user 0 succeeded
2020-11-24 21:37:47,494 INFO supervisord started with pid 68
2020-11-24 21:37:48,496 INFO spawned: 'docusaurus' with pid 70
supervisor: couldn't chdir to /docusaurus/website: ENOENT
supervisor: child process was not spawned
2020-11-24 21:37:48,502 INFO exited: docusaurus (exit status 127; not expected)
2020-11-24 21:37:49,504 INFO gave up: docusaurus entered FATAL state, too many start retries too quickly
^C2020-11-24 21:37:56,511 WARN received SIGINT indicating exit request

Unable to launch a new test project

I have been using Docusaurus for several months, on a dedicated VM.
I am now trying your solution because I would like to use CI to build and publish our documentation.
Whatever I try, even in test mode, I get a FATAL error.

Here is what I am doing on my Linux workstation where docker is installed:

  1. I create an empty project folder in my home folder: tst
  2. I create a website folder within
  3. I execute from the Terminal:
docker run -it --rm \
-p 80:80 \
-v /home/stsinc/tst:/docusaurus \
awesometic/docusaurus

And I get this error log:

Variables:
	- UID=1000
	- GID=1000
	- AUTO_UPDATE=true
	- WEBSITE_NAME=MyWebsite
	- TEMPLATE=classic
	- RUN_MODE=development
/* Register a new cron job for auto updating... */
/* Successfully registered. */
/* Install docusaurus... */
npm WARN exec The following package was not found and will be installed: @docusaurus/init@latest
sh: docusaurus-init: Permission denied
npm notice 
npm notice New minor version of npm available! 8.0.0 -> 8.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.3.0
npm notice Run npm install -g [email protected] to update!
npm notice 
ln: /docusaurus/website/MyWebsite: File exists
/* Installing node modules... */
/init.sh: line 54: cd: /docusaurus/MyWebsite: No such file or directory
yarn install v1.22.15
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.11s.
/* Start supervisord to start Docusaurus... */
2021-12-12 20:07:32,833 INFO Set uid to user 0 succeeded
2021-12-12 20:07:32,836 INFO supervisord started with pid 48
2021-12-12 20:07:33,838 INFO spawned: 'docusaurus' with pid 49
/* Will run this Node service as development mode... */
yarn run v1.22.15
error Couldn't find a package.json file in "/docusaurus/website"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2021-12-12 20:07:34,051 INFO exited: docusaurus (exit status 1; not expected)
2021-12-12 20:07:35,051 INFO gave up: docusaurus entered FATAL state, too many start retries too quickly

I understand the error error Couldn't find a package.json file in "/docusaurus/website"is essential but I am in test mode and I am not suppposed to have any package.json file yet.
What am I doing wrong?

could not to run website

this is container logs:

 Variables:
	- UID=1000
	- GID=1000
	- AUTO_UPDATE=true
	- WEBSITE_NAME=doc
	- TEMPLATE=classic
	- RUN_MODE=development
/* Register a new cron job for auto updating... */
/* Successfully registered. */
/* Install docusaurus... */
npm ERR! code EAI_AGAIN
npm ERR! syscall getaddrinfo
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/@docusaurus%2finit failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-03-27T07_42_55_373Z-debug-0.log
ln: /docusaurus/website: File exists
/* Installing node modules... */
/init.sh: line 54: cd: /docusaurus/aquila-doc: No such file or directory
yarn install v1.22.19
warning You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.14s.
/* Start supervisord to start Docusaurus... */
2023-03-27 07:44:22,208 INFO Set uid to user 0 succeeded
2023-03-27 07:44:22,214 INFO supervisord started with pid 47
2023-03-27 07:44:23,222 INFO spawned: 'docusaurus' with pid 48
supervisor: couldn't chdir to /docusaurus/website: ENOENT
supervisor: child process was not spawned
2023-03-27 07:44:23,230 INFO exited: docusaurus (exit status 127; not expected)
2023-03-27 07:44:23,231 INFO gave up: docusaurus entered FATAL state, too many start retries too quickly

and this is my folder:

$ ls doc
babel.config.js  docs  docusaurus.config.js  package.json  package-lock.json  README.md  sidebars.js  src  static  tsconfig.json

docker command:

docker run -d --name docusaurus -p 80:80 -v doc:/docusaurus -e TARGET_UID=1000 -e TARGET_GID=1000 -e AUTO_UPDATE=true -e WEBSITE_NAME="doc" -e TEMPLATE=classic awesometic/docusaurus

how to use this docker image with an exsit docusaurus project

HI, I got a problem with using your docker image with my local docusaurus project when I'm going to create a docker-compose.yml, every time when I used docker-compose up command , it always create a new Folder and won't work with my old docs.

here is my docker-compose.yml, can you show me how to use this docker image with an exsit docusaurus project?

Thanks!

version: '3'

services:
  docusaurus:
    image: awesometic/docusaurus:latest
    container_name: docusaurus
    build: .
    ports:
      - 3000:3000
      - 35729:35729
    volumes:
      - ./docs:/docusaurus/docs
      - ./blog:/docusaurus/blog
      - ./src:/docusaurus/src
      - ./static:/docusaurus/static
      - ./sidebars.json:/docusaurus/sidebars.json
      - ./docusaurus.config.js:/docusaurus/docusaurus.config.js
    working_dir: /docusaurus
    command: 
      - npm run start

The Output likes:

...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 345.13s.
docusaurus  | 
docusaurus  | 
docusaurus  | Successfully created "MyWebsite".
docusaurus  | Inside that directory, you can run several commands:
docusaurus  | 
docusaurus  |   yarn start
docusaurus  |     Starts the development server.
docusaurus  | 
docusaurus  |   yarn build
docusaurus  |     Bundles your website into static files for production.
docusaurus  | 
docusaurus  |   yarn serve
docusaurus  |     Serves the built website locally.
docusaurus  | 
docusaurus  |   yarn deploy
docusaurus  |     Publishes the website to GitHub pages.
docusaurus  | 
docusaurus  | We recommend that you begin by typing:
docusaurus  | 
docusaurus  |   cd MyWebsite
docusaurus  |   yarn start
docusaurus  | 
docusaurus  | Happy building awesome websites!
docusaurus  | 
docusaurus  | npm notice 
docusaurus  | npm notice New major version of npm available! 8.19.2 -> 9.2.0
docusaurus  | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.2.0>
docusaurus  | npm notice Run `npm install -g [email protected]` to update!
docusaurus  | npm notice 
docusaurus  | /* Node modules already exist in /docusaurus/MyWebsite/node_modules */
docusaurus  | /* Start supervisord to start Docusaurus... */
docusaurus  | 2022-12-29 07:48:50,213 INFO Set uid to user 0 succeeded
docusaurus  | 2022-12-29 07:48:50,220 INFO supervisord started with pid 88
docusaurus  | 2022-12-29 07:48:51,224 INFO spawned: 'docusaurus' with pid 89
docusaurus  | /* Will run this Node service as development mode... */
docusaurus  | yarn run v1.22.19
docusaurus  | $ docusaurus start --port 80 --host 0.0.0.0
docusaurus  | 2022-12-29 07:48:52,547 INFO success: docusaurus entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
docusaurus  | Starting the development server...
docusaurus  | Docusaurus website is running at "http://localhost:80/".
docusaurus  | ℹ Compiling Client
docusaurus  | ℹ 「wds」: Project is running at http://0.0.0.0:80/
docusaurus  | ℹ 「wds」: webpack output is served from /
docusaurus  | ℹ 「wds」: Content not from webpack is served from /docusaurus/MyWebsite
docusaurus  | ℹ 「wds」: 404s will fallback to /index.html
docusaurus  | ✔ Client: Compiled successfully in 15.97s

INFO gave up: docusaurus entered FATAL state

I got the same issue as stated in#5 but couldn't resolve it.

I try to create the container under Unraid so the command looks a bit different than usual but for general useability it should be the same.

docker run
  -d
  --name='docusaurus'
  --net='bridge'
  -e TZ="Europe/Berlin"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Fribb-Tower"
  -e HOST_CONTAINERNAME="docusaurus"
  -e 'TARGET_UID'='99'
  -e 'TARGET_GID'='100'
  -e 'AUTO_UPDATE'='true'
  -e 'WEBSITE_NAME'='test'
  -e 'TEMPLATE'='classic'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.webui='http://[IP]:[PORT]/'
  -p '8082:80/tcp'
  -v '/mnt/user/appdata/docusaurus':'/docusaurus':'rw' 'awesometic/docusaurus'

I can see that the command is creating the docusaurus folder and when I create a "test" folder in it and restart the container it creates a node_modules folder and yarn.lock file. So permission issues shouldn't be the case.

Still, the log output is:

Variables:
        - UID=99
        - GID=100
        - AUTO_UPDATE=true
        - WEBSITE_NAME=test
        - TEMPLATE=classic
        - RUN_MODE=development
/* Register a new cron job for auto updating... */
/* Successfully registered. */
/* Docusaurus configuration already exists in the target directory /docusaurus */
/* Node modules already exist in /docusaurus/test/node_modules */
/* Start supervisord to start Docusaurus... */
2023-03-14 09:40:04,107 INFO Set uid to user 0 succeeded
2023-03-14 09:40:04,108 INFO supervisord started with pid 11
2023-03-14 09:40:05,111 INFO spawned: 'docusaurus' with pid 12
/* Will run this Node service as development mode... */
yarn run v1.22.19
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2023-03-14 09:40:05,276 INFO exited: docusaurus (exit status 1; not expected)
2023-03-14 09:40:06,278 INFO gave up: docusaurus entered FATAL state, too many start retries too quickly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.