FROM ghcr.io/danny-avila/librechat-dev:latest # Expose ports (3080 for LibreChat, 8000 for RAG API) EXPOSE 3080 # Set environment variables (minimal set - the rest go in HF Spaces settings) ENV HOST=0.0.0.0 ENV PORT=3080 ENV SESSION_EXPIRY=900000 ENV REFRESH_TOKEN_EXPIRY=604800000 # Create directories and set permissions RUN mkdir -p /app/uploads/temp /app/client/public/images/temp /app/api/logs/ /app/data RUN chmod -R 777 /app/uploads/temp /app/client/public/images /app/api/logs/ /app/data # Copy Custom Endpoints Config (keep as is for now) RUN curl -o /app/librechat.yaml https://raw.githubusercontent.com/fuegovic/lc-config-yaml/main/librechat-rw.yaml # COPY librechat.yaml /app/librechat.yaml # Uncomment this to use a local file instead # Install api dependencies RUN cd /app/api && npm install # START RAG API (This is the crucial addition) # We use a single CMD to start both the backend AND the RAG API in the background. CMD (npm run backend)