From da0a062c05db18d8c1521661ac0ab735abff3c3f Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 8 Oct 2023 09:59:18 -0700 Subject: [PATCH] feat: docker support for v4 (closes #530) --- Dockerfile | 11 +++++++++++ docs/features/Docker Support.md | 7 +++++++ docs/index.md | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 docs/features/Docker Support.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..1d9e5915f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:20-slim as builder +WORKDIR /usr/src/app +COPY package.json . +COPY package-lock.json* . +RUN npm ci + +FROM node:20-slim +WORKDIR /usr/src/app +COPY --from=builder /usr/src/app/ /usr/src/app/ +COPY . . +CMD ["npx", "quartz", "build", "--serve"] diff --git a/docs/features/Docker Support.md b/docs/features/Docker Support.md new file mode 100644 index 000000000..cf73b7fcc --- /dev/null +++ b/docs/features/Docker Support.md @@ -0,0 +1,7 @@ +Quartz comes shipped with a Docker image that will allow you to preview your Quartz locally without installing Node. + +You can run the below one-liner to run Quartz in Docker. + +```sh +docker run --rm -itp 8080:8080 $(docker build -q .) +``` diff --git a/docs/index.md b/docs/index.md index f846cc7ea..85afee1f0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -30,7 +30,7 @@ This will guide you through initializing your Quartz with content. Once you've d ## 🔧 Features -- [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[Latex]], [[syntax highlighting]], [[popover previews]], and [many more](./features) right out of the box +- [[Obsidian compatibility]], [[full-text search]], [[graph view]], note transclusion, [[wikilinks]], [[backlinks]], [[Latex]], [[syntax highlighting]], [[popover previews]], [[Docker Support]], and [many more](./features) right out of the box - Hot-reload for both configuration and content - Simple JSX layouts and [[creating components|page components]] - [[SPA Routing|Ridiculously fast page loads]] and tiny bundle sizes