Spaces:
Running
Running
| # Stage 1: Embed Service | |
| FROM cppd86/embed_service:latest AS embed_source | |
| # Stage 2: RAG Service | |
| FROM cppd86/rag_service:latest AS rag_source | |
| # Stage 3: Runtime | |
| FROM python:3.10-slim | |
| RUN apt-get update && apt-get install -y supervisor --no-install-recommends && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| # COPY ONLY the /app folder from your original images | |
| COPY --from=embed_source /app /app/embed_service/app | |
| COPY --from=rag_source /app /app/rag_service/app | |
| # Install all dependencies at once | |
| RUN pip install --upgrade pip | |
| RUN pip install --no-cache-dir \ | |
| fastapi uvicorn requests pinecone-client sentence-transformers flask supervisor jinja2 python-multipart python-dotenv markdown markdown2 langsmith aiohttp fastapi uvicorn[standard] python-multipart jinja2 markdown python-dotenv aiohttp cachetools numpy pymongo redis pinecone[grpc] pinecone-text protobuf langchain langchain-core langchain-community langchain-huggingface langchain-text-splitters langsmith pypdf pymupdf transformers langchain_nvidia_ai_endpoints unstructured unstructured[all-docs] unstructured[md] | |
| COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | |
| RUN mkdir -p /var/log/supervisor && chown -R user:user /app /var/log/supervisor /var/run | |
| USER user | |
| EXPOSE 7860 | |
| CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] |