Skip to content

Commit b90c144

Browse files
committed
feat: 添加 Docker 支持 #34
1 parent 36c40b7 commit b90c144

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

.dockerignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
node_modules
2+
npm-debug.log
3+
Dockerfile*
4+
docker-compose*
5+
.dockerignore
6+
.git
7+
.github
8+
.gitignore
9+
README.md
10+
LICENSE
11+
.vscode
12+
dist
13+
build
14+
images
15+
script

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:16
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
EXPOSE 6688
12+
13+
CMD ["npm", "start"]

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,28 @@ pnpm install
6868
pnpm start
6969
```
7070

71+
## Docker 部署
72+
73+
> 安装及配置 Docker 将不在此处说明,请自行解决
74+
75+
### 本地构建
76+
77+
```bash
78+
// 构建
79+
docker build -t dailyhot-api .
80+
// 运行
81+
docker run -p 6688:6688 -d dailyhot-api
82+
```
83+
84+
### 在线部署
85+
86+
```bash
87+
// 拉取
88+
docker pull imsyy/dailyhot-api:1.0.4
89+
// 运行
90+
docker run -p 6688:6688 -d imsyy/dailyhot-api:1.0.4
91+
```
92+
7193
## Vercel 部署
7294

7395
现已支持 Vercel 部署,无需服务器

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dailyhot_api",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "一个今日热榜",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)