Spaces:
Sleeping
Sleeping
File size: 701 Bytes
8a5fc23 0f95125 8a5fc23 0f95125 8a5fc23 0f95125 8a5fc23 0f95125 8a5fc23 0f95125 8a5fc23 0f95125 8a5fc23 0f95125 8a5fc23 | 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 node:18 AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PORT=7860
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
COPY --chown=user requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
COPY --chown=user ai_agent.py server.py ./
COPY --chown=user frontend ./frontend
COPY --from=frontend-build --chown=user /app/frontend/build ./frontend/build
EXPOSE 7860
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
|