-
Notifications
You must be signed in to change notification settings - Fork 169
/
Copy pathdocker-compose.yml
64 lines (60 loc) · 2.45 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
services:
fastapi_app:
build:
context: . # Keep the build context as the root directory
dockerfile: dev.Dockerfile
entrypoint: /app/scripts/entrypoint.sh
ports:
- "8000:8000"
environment:
- APP_TYPE=fastapi
- CELERY_BROKER_URL=${CELERY_BROKER_URL-redis://redis:6379/0}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND-redis://redis:6379/0}
- LLM_PULL_API_URL=${LLM_PULL_API_URL-http://web:8000/llm_pull}
- LLM_GENEREATE_API_URL=${LLM_GENEREATE_API_URL-http://web:8000/llm_generate}
- OLLAMA_HOST=${OLLAMA_HOST-http://ollama:11434}
- APP_ENV=${APP_ENV-development} # Default to development mode
- STORAGE_PROFILE_PATH=${STORAGE_PROFILE_PATH-/app/storage_profiles} # Add the storage profile path
- LIST_FILES_URL=${LIST_FILES_URL-http://localhost:8000/storage/list}
- LOAD_FILE_URL=${LOAD_FILE_URL-http://localhost:8000/storage/load}
- DELETE_FILE_URL=${DELETE_FILE_URL-http://localhost:8000/storage/delete}
- REMOTE_API_URL=${REMOTE_API_URL}
depends_on:
- redis
- ollama
volumes: &appvolumes
- .:/app # Mount the text_extract_api directory to enable auto-reloading
celery_worker:
build:
context: . # Keep the build context as the root directory
dockerfile: dev.Dockerfile
entrypoint: /app/scripts/entrypoint.sh
environment:
- APP_TYPE=celery
- OLLAMA_HOST=${OLLAMA_HOST-http://ollama:11434}
- CELERY_BROKER_URL=${CELERY_BROKER_URL-redis://redis:6379/0}
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND-redis://redis:6379/0}
- STORAGE_PROFILE_PATH=${STORAGE_PROFILE_PATH-/app/storage_profiles} # Add the storage profile path
- LIST_FILES_URL=${LIST_FILES_URL-http://localhost:8000/storage/list}
- LOAD_FILE_URL=${LOAD_FILE_URL-http://localhost:8000/storage/load}
- DELETE_FILE_URL=${DELETE_FILE_URL-http://localhost:8000/storage/delete}
depends_on:
- redis
- fastapi_app
volumes: *appvolumes
redis:
image: redis:7.2.4-alpine
ports:
- "${REDIS_HOST_PORT:-6379}:6379"
ollama:
image: ollama/ollama # Use the official Ollama image
pull_policy: always
tty: true
restart: always
ports:
- "11434:11434" # Expose Ollama's API port, changing internal to external port
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:11434/"] # Assumes health endpoint exists
interval: 30s
timeout: 10s
retries: 3