Configure Docker for Linux host networking and add startup reindex
- Switch to host network mode for direct access to Ollama on host - Update OLLAMA_URL to use localhost:11434 - Add startup.sh script to trigger reindex before app starts - Update Dockerfile to execute startup script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,8 @@ RUN uv pip install --system -e .
|
|||||||
|
|
||||||
# Copy application code
|
# Copy application code
|
||||||
COPY *.py ./
|
COPY *.py ./
|
||||||
|
COPY startup.sh ./
|
||||||
|
RUN chmod +x startup.sh
|
||||||
|
|
||||||
# Copy frontend code and build
|
# Copy frontend code and build
|
||||||
COPY raggr-frontend ./raggr-frontend
|
COPY raggr-frontend ./raggr-frontend
|
||||||
@@ -40,5 +42,5 @@ EXPOSE 8080
|
|||||||
ENV PYTHONPATH=/app
|
ENV PYTHONPATH=/app
|
||||||
ENV CHROMADB_PATH=/app/chromadb
|
ENV CHROMADB_PATH=/app/chromadb
|
||||||
|
|
||||||
# Run the Flask application
|
# Run the startup script
|
||||||
CMD ["python", "app.py"]
|
CMD ["./startup.sh"]
|
||||||
@@ -3,24 +3,15 @@ version: '3.8'
|
|||||||
services:
|
services:
|
||||||
raggr:
|
raggr:
|
||||||
image: torrtle/simbarag:latest
|
image: torrtle/simbarag:latest
|
||||||
ports:
|
network_mode: host
|
||||||
- "8080:8080"
|
|
||||||
environment:
|
environment:
|
||||||
- PAPERLESS_TOKEN=${PAPERLESS_TOKEN}
|
- PAPERLESS_TOKEN=${PAPERLESS_TOKEN}
|
||||||
- BASE_URL=${BASE_URL}
|
- BASE_URL=${BASE_URL}
|
||||||
- OLLAMA_URL=${OLLAMA_URL:-http://172.17.0.1:11434}
|
- OLLAMA_URL=${OLLAMA_URL:-http://localhost:11434}
|
||||||
- CHROMADB_PATH=/app/chromadb
|
- CHROMADB_PATH=/app/chromadb
|
||||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||||
volumes:
|
volumes:
|
||||||
- chromadb_data:/app/chromadb
|
- chromadb_data:/app/chromadb
|
||||||
networks:
|
|
||||||
- raggr-network
|
|
||||||
extra_hosts:
|
|
||||||
- "host.docker.internal:host-gateway"
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
chromadb_data:
|
chromadb_data:
|
||||||
|
|
||||||
networks:
|
|
||||||
raggr-network:
|
|
||||||
driver: bridge
|
|
||||||
7
startup.sh
Normal file
7
startup.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Starting reindex process..."
|
||||||
|
python main.py "" --reindex
|
||||||
|
|
||||||
|
echo "Starting Flask application..."
|
||||||
|
python app.py
|
||||||
Reference in New Issue
Block a user