| |
| FROM node:20-alpine AS frontend-build |
| WORKDIR /frontend |
| COPY frontend/package.json ./ |
| RUN npm install |
| COPY frontend/ ./ |
| RUN npm run build |
|
|
| |
| FROM python:3.11-slim |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
| ENV PATH="/home/user/.local/bin:$PATH" |
| ENV HF_HOME="/home/user/.cache/huggingface" |
|
|
| WORKDIR /app |
|
|
| COPY --chown=user backend/requirements.txt requirements.txt |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt |
|
|
| COPY --chown=user backend/ . |
| COPY --chown=user --from=frontend-build /frontend/dist ./static |
|
|
| EXPOSE 7860 |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |