feat: 优化 Docker 大小

This commit is contained in:
imsyy 2023-12-06 12:25:09 +08:00
parent b90c144a62
commit a4394588c1
3 changed files with 5 additions and 8 deletions

View File

@ -1,13 +1,10 @@
FROM node:16 FROM node:16-alpine
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm install --production
RUN npm install
COPY . . COPY . .
EXPOSE 6688 EXPOSE 6688
CMD ["npm", "start"] CMD ["npm", "start"]

View File

@ -85,9 +85,9 @@ docker run -p 6688:6688 -d dailyhot-api
```bash ```bash
// 拉取 // 拉取
docker pull imsyy/dailyhot-api:1.0.4 docker pull imsyy/dailyhot-api:1.0.5
// 运行 // 运行
docker run -p 6688:6688 -d imsyy/dailyhot-api:1.0.4 docker run -p 6688:6688 -d imsyy/dailyhot-api:1.0.5
``` ```
## Vercel 部署 ## Vercel 部署

View File

@ -1,6 +1,6 @@
{ {
"name": "dailyhot_api", "name": "dailyhot_api",
"version": "1.0.4", "version": "1.0.5",
"description": "一个今日热榜", "description": "一个今日热榜",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {