Skip to content

Commit 8b9dabe

Browse files
author
gptkong
committed
add Vite Chinese documentation Docker setup and update README
1 parent e95c9ae commit 8b9dabe

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ This repository contains Dockerfiles and related resources for building and runn
2525
- `lucide-icon-docs/`
2626
- Contains the Dockerfile for building the Lucide Icon documentation site.
2727
- GitHub Repository: [Lucide Icons](https://github.com/lucide-icons/lucide)
28+
- `vitejs/`
29+
- Contains the Dockerfile for building the Vite Chinese documentation site.
30+
- GitHub Repository: [Vite Chinese Docs](https://github.com/vitejs/docs-cn)
2831

2932
## Usage
3033

vitejs/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM node:22-alpine AS builder
2+
3+
RUN apk add --no-cache git
4+
5+
WORKDIR /app
6+
7+
RUN git clone -b v6.0.0 https://github.com/vitejs/docs-cn.git
8+
9+
WORKDIR /app/docs-cn
10+
11+
RUN npm install -g pnpm
12+
13+
RUN pnpm install
14+
15+
RUN pnpm run build
16+
17+
FROM nginx:alpine
18+
19+
COPY --from=builder /app/docs-cn/.vitepress/dist /usr/share/nginx/html
20+
21+
EXPOSE 80
22+
23+
CMD ["nginx", "-g", "daemon off;"]

vitejs/nginx.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
index index.html;
6+
7+
location / {
8+
try_files $uri $uri/ /index.html;
9+
add_header Cache-Control "no-cache, must-revalidate";
10+
}
11+
12+
error_page 500 502 503 504 /50x.html;
13+
location = /50x.html {
14+
root /usr/share/nginx/html;
15+
}
16+
}

0 commit comments

Comments
 (0)