mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 00:23:17 +00:00
speed up scripts by using docker hub
This commit is contained in:
71
deployment/docker-compose-hub.yaml
Normal file
71
deployment/docker-compose-hub.yaml
Normal file
@@ -0,0 +1,71 @@
|
||||
name: docsgpt-oss
|
||||
services:
|
||||
frontend:
|
||||
image: arc53/docsgpt:develop # some changes required here
|
||||
environment:
|
||||
- VITE_API_HOST=http://localhost:7091
|
||||
- VITE_API_STREAMING=$VITE_API_STREAMING
|
||||
ports:
|
||||
- "5173:5173"
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
backend:
|
||||
user: root
|
||||
image: arc53/docsgpt:develop # some changes required here
|
||||
environment:
|
||||
- API_KEY=$API_KEY
|
||||
- EMBEDDINGS_KEY=$API_KEY
|
||||
- LLM_PROVIDER=$LLM_PROVIDER
|
||||
- LLM_NAME=$LLM_NAME
|
||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://redis:6379/1
|
||||
- MONGO_URI=mongodb://mongo:27017/docsgpt
|
||||
- CACHE_REDIS_URL=redis://redis:6379/2
|
||||
- OPENAI_BASE_URL=$OPENAI_BASE_URL
|
||||
ports:
|
||||
- "7091:7091"
|
||||
volumes:
|
||||
- ../application/indexes:/app/indexes
|
||||
- ../application/inputs:/app/inputs
|
||||
- ../application/vectors:/app/vectors
|
||||
depends_on:
|
||||
- redis
|
||||
- mongo
|
||||
|
||||
worker:
|
||||
user: root
|
||||
image: arc53/docsgpt:develop # some changes required here
|
||||
command: celery -A application.app.celery worker -l INFO -B
|
||||
environment:
|
||||
- API_KEY=$API_KEY
|
||||
- EMBEDDINGS_KEY=$API_KEY
|
||||
- LLM_PROVIDER=$LLM_PROVIDER
|
||||
- LLM_NAME=$LLM_NAME
|
||||
- CELERY_BROKER_URL=redis://redis:6379/0
|
||||
- CELERY_RESULT_BACKEND=redis://redis:6379/1
|
||||
- MONGO_URI=mongodb://mongo:27017/docsgpt
|
||||
- API_URL=http://backend:7091
|
||||
- CACHE_REDIS_URL=redis://redis:6379/2
|
||||
volumes:
|
||||
- ../application/indexes:/app/indexes
|
||||
- ../application/inputs:/app/inputs
|
||||
- ../application/vectors:/app/vectors
|
||||
depends_on:
|
||||
- redis
|
||||
- mongo
|
||||
|
||||
redis:
|
||||
image: redis:6-alpine
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
mongo:
|
||||
image: mongo:6
|
||||
ports:
|
||||
- 27017:27017
|
||||
volumes:
|
||||
- mongodb_data_container:/data/db
|
||||
|
||||
volumes:
|
||||
mongodb_data_container:
|
||||
24
setup.ps1
24
setup.ps1
@@ -9,7 +9,7 @@ $ErrorActionPreference = "Stop"
|
||||
|
||||
# Get current script directory
|
||||
$SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||
$COMPOSE_FILE = Join-Path -Path $SCRIPT_DIR -ChildPath "deployment\docker-compose.yaml"
|
||||
$COMPOSE_FILE = Join-Path -Path $SCRIPT_DIR -ChildPath "deployment\docker-compose-hub.yaml"
|
||||
$ENV_FILE = Join-Path -Path $SCRIPT_DIR -ChildPath ".env"
|
||||
|
||||
# Function to write colored text
|
||||
@@ -304,9 +304,9 @@ function Use-DocsPublicAPIEndpoint {
|
||||
|
||||
# Run Docker compose commands
|
||||
try {
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" build
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" pull
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Docker compose build failed with exit code $LASTEXITCODE"
|
||||
throw "Docker compose pull failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" up -d
|
||||
@@ -415,10 +415,10 @@ function Serve-LocalOllama {
|
||||
Write-Host ""
|
||||
Write-ColorText "Starting Docker Compose with Ollama ($docker_compose_file_suffix)..." -ForegroundColor "White"
|
||||
|
||||
# Build the containers
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" -f "$optional_compose" build
|
||||
# Pull the containers
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" -f "$optional_compose" pull
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Docker compose build failed with exit code $LASTEXITCODE"
|
||||
throw "Docker compose pull failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
|
||||
# Start the containers
|
||||
@@ -575,10 +575,10 @@ function Connect-LocalInferenceEngine {
|
||||
Write-Host ""
|
||||
Write-ColorText "Starting Docker Compose..." -ForegroundColor "White"
|
||||
|
||||
# Build the containers
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" build
|
||||
# Pull the containers
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" pull
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Docker compose build failed with exit code $LASTEXITCODE"
|
||||
throw "Docker compose pull failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
|
||||
# Start the containers
|
||||
@@ -706,11 +706,13 @@ function Connect-CloudAPIProvider {
|
||||
Write-ColorText "Starting Docker Compose..." -ForegroundColor "White"
|
||||
|
||||
# Run Docker compose commands
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" up -d --build
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" pull
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Docker compose build or up failed with exit code $LASTEXITCODE"
|
||||
throw "Docker compose pull failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
|
||||
& docker compose --env-file "$ENV_FILE" -f "$COMPOSE_FILE" up -d
|
||||
|
||||
Write-Host ""
|
||||
Write-ColorText "DocsGPT is now configured to use $provider_name on http://localhost:5173" -ForegroundColor "Green"
|
||||
Write-ColorText "You can stop the application by running: docker compose -f `"$COMPOSE_FILE`" down" -ForegroundColor "Yellow"
|
||||
|
||||
10
setup.sh
10
setup.sh
@@ -9,7 +9,7 @@ NC='\033[0m'
|
||||
BOLD='\033[1m'
|
||||
|
||||
# Base Compose file (relative to script location)
|
||||
COMPOSE_FILE="$(dirname "$(readlink -f "$0")")/deployment/docker-compose.yaml"
|
||||
COMPOSE_FILE="$(dirname "$(readlink -f "$0")")/deployment/docker-compose-hub.yaml"
|
||||
ENV_FILE="$(dirname "$(readlink -f "$0")")/.env"
|
||||
|
||||
# Animation function
|
||||
@@ -176,7 +176,7 @@ use_docs_public_api_endpoint() {
|
||||
check_and_start_docker
|
||||
|
||||
echo -e "\n${NC}Starting Docker Compose...${NC}"
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" build && docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" up -d
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" pull && docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" up -d
|
||||
docker_compose_status=$? # Capture exit status of docker compose
|
||||
|
||||
echo "Docker Compose Exit Status: $docker_compose_status"
|
||||
@@ -252,7 +252,7 @@ serve_local_ollama() {
|
||||
)
|
||||
|
||||
echo -e "\n${NC}Starting Docker Compose with Ollama (${docker_compose_file_suffix})...${NC}"
|
||||
docker compose --env-file "${ENV_FILE}" "${compose_files[@]}" build
|
||||
docker compose --env-file "${ENV_FILE}" "${compose_files[@]}" pull
|
||||
docker compose --env-file "${ENV_FILE}" "${compose_files[@]}" up -d
|
||||
docker_compose_status=$?
|
||||
|
||||
@@ -360,7 +360,7 @@ connect_local_inference_engine() {
|
||||
check_and_start_docker
|
||||
|
||||
echo -e "\n${NC}Starting Docker Compose...${NC}"
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" build && docker compose -f "${COMPOSE_FILE}" up -d
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" pull && docker compose -f "${COMPOSE_FILE}" up -d
|
||||
docker_compose_status=$?
|
||||
|
||||
echo "Docker Compose Exit Status: $docker_compose_status" # Debug output
|
||||
@@ -449,7 +449,7 @@ connect_cloud_api_provider() {
|
||||
check_and_start_docker
|
||||
|
||||
echo -e "\n${NC}Starting Docker Compose...${NC}"
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" up -d --build
|
||||
docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" pull && docker compose --env-file "${ENV_FILE}" -f "${COMPOSE_FILE}" up -d
|
||||
docker_compose_status=$?
|
||||
|
||||
echo "Docker Compose Exit Status: $docker_compose_status" # Debug output
|
||||
|
||||
Reference in New Issue
Block a user