Skip to content

Commit

Permalink
Use pre-built Docusaurus image (FerretDB#1365)
Browse files Browse the repository at this point in the history
That removes the need to rebuild it every time, removes node.js dependencies from the repo, etc.
  • Loading branch information
AlekSi authored Nov 3, 2022
1 parent f084e6a commit 24d8bc4
Show file tree
Hide file tree
Showing 10 changed files with 1,954 additions and 2,267 deletions.
17 changes: 0 additions & 17 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ updates:
interval: "weekly"
day: "thursday"
time: "01:42"
- package-ecosystem: "docker"
directory: "/website"
labels: [deps]
schedule:
interval: "weekly"
day: "thursday"
time: "01:42"

- package-ecosystem: "gomod"
directory: "/"
Expand All @@ -52,13 +45,3 @@ updates:
interval: "weekly"
day: "thursday"
time: "01:42"

- package-ecosystem: "npm"
directory: "/website"
labels: [deps]
schedule:
interval: "weekly"
day: "thursday"
time: "01:42"
allow:
- dependency-name: "@docusaurus/*"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ vendor/
*.deb
*.rpm
*.tar
website/build/

# test coverage results, generated files like commit.txt, etc.
*.txt
Expand Down
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ tasks:
desc: "Format, lint and build documentation"
deps: [docs-fmt]
cmds:
- docker-compose run --rm docusaurus build
- docker-compose run --rm docusaurus-docs build

# see https://github.com/DavidAnson/markdownlint-cli2#command-line for the reason we use double-quotes
docs-fmt:
Expand All @@ -403,4 +403,4 @@ tasks:
docs-dev:
desc: "Start documentation development server"
cmds:
- docker-compose run --rm --service-ports docusaurus start --host=0.0.0.0
- docker-compose run --rm --service-ports docusaurus-docs start --host=0.0.0.0
3 changes: 3 additions & 0 deletions build/.trivyignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Skip static website problems for now.
# TODO Remove this file once we remove all Node.js deps from this repo:
# https://github.com/FerretDB/FerretDB/issues/1133

CVE-2022-33987 exp:2023-03-01
CVE-2020-7753 exp:2023-03-01
CVE-2022-3517 exp:2023-03-01
1 change: 1 addition & 0 deletions build/deps/docusaurus-docs.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/ferretdb/docusaurus-docs:2.2.0-1
19 changes: 14 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,21 @@ services:
container_name: ferretdb_markdownlint
volumes:
- .:/workdir
docusaurus:
docusaurus-docs:
build:
context: ./website
container_name: ferretdb_docusaurus
context: ./build/deps
dockerfile: docusaurus-docs.Dockerfile
container_name: ferretdb_docusaurus-docs
ports:
- 3000:3000
volumes:
- .:/workdir
- /workdir/website/node_modules
# package.json and package-lock.json are not bound; container image already contains them.
# But we need them in the repo for Vercel.
# TODO https://github.com/FerretDB/FerretDB/issues/1133
- ./website/docs:/workdir/docusaurus-docs/docs:ro
- ./website/src:/workdir/docusaurus-docs/src:ro
- ./website/static:/workdir/docusaurus-docs/static:ro
- ./website/babel.config.js:/workdir/docusaurus-docs/babel.config.js:ro
- ./website/docusaurus.config.js:/workdir/docusaurus-docs/docusaurus.config.js:ro
- ./website/sidebars.js:/workdir/docusaurus-docs/sidebars.js:ro
- ./website/build:/workdir/docusaurus-docs/build:rw
20 changes: 0 additions & 20 deletions website/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions website/Dockerfile

This file was deleted.

Loading

0 comments on commit 24d8bc4

Please sign in to comment.