Download Dockerfile from Rfym21/PO2API: direct link, hf CLI and curl.
- Browser
- Download file 523 Bytes
-
https://huggingface.co/spaces/Rfym21/PO2API/resolve/19df229bd0f583fa4cdf2c27b7c58216b2ee8521/Dockerfile
- Command line
-
hf download hf://spaces/Rfym21/PO2API@19df229bd0f583fa4cdf2c27b7c58216b2ee8521/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Rfym21/PO2API/resolve/19df229bd0f583fa4cdf2c27b7c58216b2ee8521/Dockerfile
523 Bytes
| # 使用 node:20.16.0-alpine 作为基础镜像 | |
| FROM node:20.16.0-alpine | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 复制 package.json 和 package-lock.json 到工作目录 | |
| COPY package*.json ./ | |
| # 设置环境变量 | |
| ENV API_PREFIX=/api/ \ | |
| API_KEY=123456 \ | |
| MAX_RETRY_COUNT=3 \ | |
| RETRY_DELAY=10000 \ | |
| PORT=8787 | |
| # 安装项目依赖 | |
| RUN npm install | |
| # 复制项目的源代码到工作目录 | |
| COPY . . | |
| # 暴露应用运行的端口(假设应用运行在 3000 端口) | |
| EXPOSE 8787 | |
| # 启动应用 | |
| CMD ["node", "index.js"] |