unity / Dockerfile
gdtiti's picture
Create Dockerfile
997f032 verified
raw
history blame contribute delete
508 Bytes
# 1. 使用 Node.js 基础镜像
FROM node:18-slim
# 2. 安装 git 以便克隆仓库
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# 3. 设置工作目录
WORKDIR /app
# 4. 自动克隆仓库
# 这里直接克隆你指定的 GitHub 地址
RUN git clone https://github.com/ZeroAd-06/UNITY2api.git .
# 5. 安装依赖
RUN npm install
# 6. 强制设置端口为 7860 (Hugging Face 要求的唯一指定端口)
ENV PORT=7860
EXPOSE 7860
# 7. 启动服务
CMD ["npm", "start"]