Spaces:
Sleeping
Sleeping
File size: 680 Bytes
5e0532d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
FROM python:3.10-slim
WORKDIR /app
# 1. Install Node.js
RUN apt-get update && apt-get install -y curl gnupg
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
# 2. Copy Files
COPY . /app
# 3. Build Frontend
WORKDIR /app/frontend
RUN npm install
RUN npm run build
WORKDIR /app
# 4. Install Python Backend Dependencies
RUN pip install torch transformers peft fastapi uvicorn unsloth[colab-new]
# HF Spaces User ID Setup (Optional but recommended)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR /app
# 5. Start Backend (which serves Frontend)
CMD ["python", "app/ora_server.py"]
|