forked from Sun-ZhenXing/vuepress-python-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 661 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (19 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Builder
FROM node:20.9.0-bookworm as builder
WORKDIR /app
COPY . ./
ENV NODE_OPTIONS=--max-old-space-size=4096
RUN npm -v \
&& npm config set registry https://registry.npmmirror.com/ \
&& npm install -g pnpm \
&& pnpm -v \
&& pnpm config set registry https://registry.npmmirror.com/ \
&& pnpm install \
&& pnpm build
# Nginx Server
FROM nginx:1.25.3-alpine3.18-slim
WORKDIR /usr/share/nginx/html/vuepress-python-notes/
COPY --from=builder /app/docs/.vuepress/dist/ ./
RUN echo "<script>window.location.href = '/vuepress-python-notes/'</script>" > /usr/share/nginx/html/index.html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]