diff --git a/Dockerfile b/Dockerfile index acd64b8..bce8860 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,8 @@ RUN uv pip install --system -e . # Copy application code COPY *.py ./ +COPY startup.sh ./ +RUN chmod +x startup.sh # Copy frontend code and build COPY raggr-frontend ./raggr-frontend @@ -40,5 +42,5 @@ EXPOSE 8080 ENV PYTHONPATH=/app ENV CHROMADB_PATH=/app/chromadb -# Run the Flask application -CMD ["python", "app.py"] \ No newline at end of file +# Run the startup script +CMD ["./startup.sh"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index bd7bc27..64c109f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,24 +3,15 @@ version: '3.8' services: raggr: image: torrtle/simbarag:latest - ports: - - "8080:8080" + network_mode: host environment: - PAPERLESS_TOKEN=${PAPERLESS_TOKEN} - 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 - OPENAI_API_KEY=${OPENAI_API_KEY} volumes: - chromadb_data:/app/chromadb - networks: - - raggr-network - extra_hosts: - - "host.docker.internal:host-gateway" volumes: - chromadb_data: - -networks: - raggr-network: - driver: bridge \ No newline at end of file + chromadb_data: \ No newline at end of file diff --git a/startup.sh b/startup.sh new file mode 100644 index 0000000..4c0adc8 --- /dev/null +++ b/startup.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Starting reindex process..." +python main.py "" --reindex + +echo "Starting Flask application..." +python app.py