Skip to content

Commit

Permalink
feat: 添加 Docker 支持 imsyy#34
Browse files Browse the repository at this point in the history
  • Loading branch information
imsyy committed Dec 6, 2023
1 parent 36c40b7 commit b90c144
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.github
.gitignore
README.md
LICENSE
.vscode
dist
build
images
script
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:16

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 6688

CMD ["npm", "start"]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,28 @@ pnpm install
pnpm start
```

## Docker 部署

> 安装及配置 Docker 将不在此处说明,请自行解决
### 本地构建

```bash
// 构建
docker build -t dailyhot-api .
// 运行
docker run -p 6688:6688 -d dailyhot-api
```

### 在线部署

```bash
// 拉取
docker pull imsyy/dailyhot-api:1.0.4
// 运行
docker run -p 6688:6688 -d imsyy/dailyhot-api:1.0.4
```

## Vercel 部署

现已支持 Vercel 部署,无需服务器
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dailyhot_api",
"version": "1.0.3",
"version": "1.0.4",
"description": "一个今日热榜",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit b90c144

Please sign in to comment.