automated_api/Dockerfile

27 lines
389 B
Docker
Raw Normal View History

1. 首先创建 `Dockerfile`
2025-01-09 16:10:19 +08:00
```dockerfile
FROM node:22-alpine
WORKDIR /app
# 安装 pnpm
RUN npm config set registry https://registry.npmmirror.com && \
npm install -g pnpm && \
pnpm config set registry https://registry.npmmirror.com
# 复制项目文件
COPY . .
# 安装依赖
RUN pnpm install
# 构建项目
RUN pnpm run build
2025-01-09 16:10:19 +08:00
EXPOSE 8001
CMD ["pnpm", "start"]
```