Compare commits

...
4 Commits
5 changed files with 53 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
node_modules
dist
src/.vuepress/dist
.git
*.log
+13
View 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
View File
@@ -0,0 +1,7 @@
.PHONY: up down
up:
docker compose up -d --build
down:
docker compose down
+18
View File
@@ -42,6 +42,24 @@ npm run docs:build
构建产物将生成在 `src/.vuepress/dist` 目录
### Docker 部署
需要先安装 Docker 和 Docker Compose v2。
启动服务:
```bash
make up
```
访问 `http://localhost:6666/` 即可查看站点。
停止服务:
```bash
make down
```
### 清除缓存开发
```bash
+10
View File
@@ -0,0 +1,10 @@
version: '3.8'
services:
myblog:
image: myblog:latest
build:
context: .
ports:
- '6666:80'
restart: unless-stopped