feat: 添加 Docker 支持 #34
This commit is contained in:
parent
36c40b7870
commit
b90c144a62
15
.dockerignore
Normal file
15
.dockerignore
Normal file
@ -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
Dockerfile
Normal file
13
Dockerfile
Normal file
@ -0,0 +1,13 @@
|
||||
FROM node:16
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 6688
|
||||
|
||||
CMD ["npm", "start"]
|
22
README.md
22
README.md
@ -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 部署,无需服务器
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dailyhot_api",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "一个今日热榜",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user