Spaces:
Sleeping
Sleeping
| # --- Frontend build stage --- | |
| FROM node:18 AS build | |
| WORKDIR /app | |
| COPY package*.json ./ | |
| RUN npm install | |
| COPY . . | |
| RUN npm run build # 这里会产出 /app/dist | |
| # --- Runtime stage --- | |
| FROM python:3.10 | |
| WORKDIR /app | |
| # 复制构建产物 | |
| COPY --from=build /app/dist ./dist | |
| # 复制后端 | |
| COPY server.py ./ | |
| COPY requirements.txt ./ | |
| RUN pip install -r requirements.txt || pip install fastapi uvicorn huggingface_hub python-multipart | |
| ENV PORT=7860 | |
| CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] | |