Description
Describe the bug
Hi,
I´m trying to create a dockerimage to serve out vitepress generated files, but the resulting site doesn´t include /vue. So the search function (and others) doesn´t´work.
The docker build is multistage, so first configure the builder and generate the files (in dev mode it works), and then copy the /dist folder (output folder) to /var/www/my-site and use the nginx template in vitepress docs (slightly modified with custom folders)
Reproduction
FROM node:current-alpine as builder
WORKDIR /builder
RUN apk update
COPY /.site/package.json /builder/
COPY /.site/.vitepress/config.mts /builder/.vitepress/
COPY --exclude=/.site/ --exclude=.github/ --exclude=.gitignore --exclude=Dockerfile --exclude=.git/ . /builder/docs/
RUN npm install
RUN npm run docs:build
FROM nginx:1.27.1-alpine
COPY --from=builder /builder/.vitepress/dist /var/www/docs
RUN chown -R nginx:nginx /var/www/ -R
COPY ./.site/nginx/nginx.conf /etc/nginx/conf.d/default.conf
Expected behavior
The site should work as in dev mode (vue components work as intended)
System Info
System:
OS: Linux 5.10 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
CPU: (28) x64 13th Gen Intel(R) Core(TM) i7-13850HX
Memory: 21.44 GB / 24.77 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 22.8.0 - ~/.nvm/versions/node/v22.8.0/bin/node
npm: 10.8.2 - ~/.nvm/versions/node/v22.8.0/bin/npm
npmPackages:
vitepress: @1.3.4 => 1.3.4
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.