Some checks failed
continuous-integration/drone/push Build is failing
- Updated .drone.yml to use Docker plugin for building and pushing images - Simplified deployment steps by using Docker run command - Added Docker volume mounting for persistent data - Streamlined Dockerfile to improve build process - Configured image registry and tagging strategy
27 lines
389 B
Docker
27 lines
389 B
Docker
|
||
1. 首先创建 `Dockerfile`:
|
||
|
||
```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
|
||
|
||
EXPOSE 8001
|
||
|
||
CMD ["pnpm", "start"]
|
||
```
|