Spaces:
Sleeping
Sleeping
Add RAG implement D
Browse files12345678910111213141516171819202122232425262728293031# Get a distribution that has uv already installedFROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim# Add user - this is the user that will run the app# If you do not set user, the app will run as root (undesirable)RUN useradd -m -u 1000 userUSER user# Set the home directory and pathENV HOME=/home/user \PATH=/home/user/.local/bin:$PATHENV UVICORN_WS_PROTOCOL=websockets# Set the working directoryWORKDIR $HOME/app# Copy the app to the containerCOPY --chown=user . $HOME/app# Install the dependencies# RUN uv sync --frozenRUN uv sync# Expose the portEXPOSE 7860# Run the appCMD ["uv", "run", "chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]123456789101112131415161718192021222324252627282930313233343536373839FROM python:3.13-slim# Install Node.js and npmRUN apt-get update && apt-get install -y \curl \&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \&& apt-get install -y nodejs \&& apt-get clean \&& rm -rf /var/lib/apt/lists/*# Set working directoryWORKDIR /app# Copy backend requirementsCOPY backend/requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# Copy backend codeCOPY backend/ ./backend/COPY aimakerspace/ ./aimakerspace/# Copy frontend codeCOPY frontend/ ./frontend/# Install frontend dependencies and buildWORKDIR /app/frontendRUN npm installRUN npm run build# Set environment variablesENV OPENAI_API_KEY=${OPENAI_API_KEY}ENV PORT=7860# Expose portEXPOSE 7860# Start both backend and frontendWORKDIR /appCMD ["sh", "-c", "cd backend && uvicorn main:app --host 0.0.0.0 --port 7860"]
Dockerfile+29-21