Compare commits
4 Commits
38a7c7956e
...
4967356f22
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4967356f22 | ||
|
|
1a0c14c683 | ||
|
|
a1bf9e1d4b | ||
|
|
7238aa9ca5 |
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
src/.vuepress/dist
|
||||||
|
.git
|
||||||
|
*.log
|
||||||
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM node:20-alpine AS build
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN npm run docs:build
|
||||||
|
|
||||||
|
FROM nginx:1.25-alpine
|
||||||
|
|
||||||
|
COPY --from=build /app/src/.vuepress/dist /usr/share/nginx/html
|
||||||
7
Makefile
Normal file
7
Makefile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.PHONY: up down
|
||||||
|
|
||||||
|
up:
|
||||||
|
docker compose up -d --build
|
||||||
|
|
||||||
|
down:
|
||||||
|
docker compose down
|
||||||
18
README.md
18
README.md
@@ -42,6 +42,24 @@ npm run docs:build
|
|||||||
|
|
||||||
构建产物将生成在 `src/.vuepress/dist` 目录
|
构建产物将生成在 `src/.vuepress/dist` 目录
|
||||||
|
|
||||||
|
### Docker 部署
|
||||||
|
|
||||||
|
需要先安装 Docker 和 Docker Compose v2。
|
||||||
|
|
||||||
|
启动服务:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make up
|
||||||
|
```
|
||||||
|
|
||||||
|
访问 `http://localhost:6666/` 即可查看站点。
|
||||||
|
|
||||||
|
停止服务:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make down
|
||||||
|
```
|
||||||
|
|
||||||
### 清除缓存开发
|
### 清除缓存开发
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
myblog:
|
||||||
|
image: myblog:latest
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
ports:
|
||||||
|
- '6666:80'
|
||||||
|
restart: unless-stopped
|
||||||
Reference in New Issue
Block a user