jackyzha0 / quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
https://quartz.jzhao.xyz
MIT License
6.96k stars 2.48k forks source link

Docker image does not mount symlinks #1283

Open EntranceJew opened 3 months ago

EntranceJew commented 3 months ago

Describe the bug build --serve works fine when run in the host OS, doesn't follow symlinks in the docker image even when the host OS is linux and the /content/ symlinks was made by the create command

To Reproduce Steps to reproduce the behavior:

git clone https://github.com/jackyzha0/quartz.git
cd quartz
npm i
npx quartz create
# make sure to symlink an obsidian repo in the process
docker run --rm -itp 8080:8080 $(docker build -q .)

Expected behavior A clear and concise description of what you expected to happen.

Screenshots and Source Normal output:

ej@documental:~/skunk/quartz$ npx quartz build --serve

 Quartz v4.2.3 

(node:154864) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Cleaned output directory `public` in 3ms
Found 107 input files from `content` in 26ms
Parsed 107 Markdown files in 563ms
Filtered out 0 files in 104μs
Emitted 130 files to `public` in 219ms
Done processing 107 files in 813ms
Started a Quartz server listening at http://localhost:8080
hint: exit with ctrl+c

evil, cursed, unexpected output:

ej@documental:~/skunk/quartz$ docker run --rm -itp 8080:8080 $(docker build -q .)

 Quartz v4.2.3 

Cleaned output directory `public` in 8ms
Found 0 input files from `content` in 5ms
Parsed 0 Markdown files in 986μs
Filtered out 0 files in 5μs
⠋ Emitting output files
Warning: you seem to be missing an `index.md` home page file at the root of your `content` folder. This may cause errors when deploying.
Emitted 10 files to `public` in 29ms
Done processing 0 files in 43ms
Started a Quartz server listening at http://localhost:8080
hint: exit with ctrl+c

Desktop (please complete the following information):

Additional context this is mildly inconvenient

DrunkenToast commented 2 months ago

You can try something like this instead: docker run --rm -itp 8080:8080 -v $(pwd)/content:/usr/src/app/content $(docker build -q .)

Documentation might want to include this tidbit but in general this is something more to do with Docker than Quartz :)


Sidenote: you might want to open port 3001 as well for hotreloading