automated_api/Dockerfile
lixin 29a51d37c8
Some checks failed
continuous-integration/drone/push Build is failing
ci(drone): Refactor deployment pipeline with Docker and containerization
- 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
2025-01-25 10:17:08 +08:00

27 lines
389 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"]
```