Spaces:
Running
Running
File size: 516 Bytes
de0633e 0ea25d9 8ee051c 0ea25d9 8ee051c de0633e 8ee051c de0633e 0ea25d9 de0633e 0ea25d9 de0633e 0ea25d9 de0633e 0ea25d9 8ee051c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# --- 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"]
|