Skip to content

Commit

Permalink
Merge pull request #23 from learner-pm/dev
Browse files Browse the repository at this point in the history
feat: 更新构建相关内容
  • Loading branch information
learner-pm authored May 8, 2024
2 parents 965ee5c + 1c1dd48 commit 10e6187
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 205 deletions.
5 changes: 4 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
node_modules
.temp
cache
dist
dist
.github
.husky
code
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
npm run docs:lint
npm run prettier
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ RUN npm install
# 复制所有文件到工作目录
COPY . .

# 清空 ./vitepress/dist 目录下的内容
RUN rm -rf /app/docs/vitepress/dist/*

# 构建项目
RUN npm run docs:build

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
采用[VitePress](https://vitepress.dev/zh/)来构建静态网站。

内容全属平常记录,如果不合理的方面,欢迎指出以及提 PR。

## 学习部署工具

本地测试部署,需要k8s、docker

```bash
npm run deploy:local
```
16 changes: 2 additions & 14 deletions docs/program/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
# 编程
# 工具与技术

该模块设计非前端的其他程序员需要学习的内容

## 数据结构

了解数据结构可以深入剖析一些语法的底层实现,也可以提升程序员的代码健壮性,利于编程

## 算法

好的算法可以减少代码的复杂度,可以节省`时间``空间`的消耗

## 设计模式

设计模式可以让代码`有结构`,用好设计模式可以不至于让代码太`凌乱`
主要包含构建工具、数据结构等内容
2 changes: 1 addition & 1 deletion docs/src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const url = () => {
footer[0].appendChild(a)
}
const setText = () => {
const p = document.createElement('P')
const p = document.body.createElement('P')
p.textContent = '山不在高,有仙则灵 水不在深,有龙则灵'
p.setAttribute('class', 'home-add-text')
footer[0].insertBefore(p, footer[0].getElementsByClassName('container')[0])
Expand Down
9 changes: 5 additions & 4 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: docs-8
name: docs
spec:
replicas: 1
selector:
matchLabels:
app: docs-8
app: docs
template:
metadata:
labels:
app: docs-8
app: docs
spec:
containers:
- name: docs-8-test
- name: docs-container
image: pengmmm/docs:latest
imagePullPolicy: Always
ports:
- containerPort: 80 ## 暴露的端口
6 changes: 3 additions & 3 deletions k8s/service.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: docs-8-service
name: docs-service
spec:
selector:
app: docs-8
app: docs
ports:
- protocol: TCP
port: 8080 ## service暴露的端口
targetPort: 80 ## 容器的短裤
nodePort: 32215 ## 指定访问的端口
nodePort: 32216 ## 指定访问的端口
type: NodePort
Loading

0 comments on commit 10e6187

Please sign in to comment.