Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying generated file to www folder to be served by nginx doesn´t work #4219

Open
4 tasks done
CyberSeppi opened this issue Sep 20, 2024 · 0 comments
Open
4 tasks done
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@CyberSeppi
Copy link

CyberSeppi commented Sep 20, 2024

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.
2024-09-20 09_03_15-Screenshot

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

@CyberSeppi CyberSeppi added the bug: pending triage Maybe a bug, waiting for confirmation label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

1 participant