274 lines
7.3 KiB
YAML
274 lines
7.3 KiB
YAML
services:
|
|
backstory:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: backstory
|
|
#image: backstory
|
|
container_name: backstory
|
|
restart: "always"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- PRODUCTION=0
|
|
- FRONTEND_URL=https://backstory-beta.ketrenos.com
|
|
- MODEL_NAME=${MODEL_NAME:-qwen2.5:7b}
|
|
- REDIS_URL=redis://redis:6379
|
|
- REDIS_DB=0
|
|
- SSL_ENABLED=true
|
|
devices:
|
|
- /dev/dri:/dev/dri
|
|
depends_on:
|
|
- ollama
|
|
- redis
|
|
networks:
|
|
- internal
|
|
ports:
|
|
- 7860:7860 # gradio port for testing
|
|
- 8912:8911 # FastAPI React server
|
|
volumes:
|
|
- ./cache:/root/.cache # Persist all models and GPU kernel cache
|
|
- ./sessions:/opt/backstory/sessions:rw # Persist sessions
|
|
- ./dev-keys:/opt/backstory/keys:ro # Developer keys
|
|
- ./users:/opt/backstory/users:rw # Live mount of user data
|
|
- ./src:/opt/backstory/src:rw # Live mount server src
|
|
- ./frontend/src/types:/opt/backstory/frontend/src/types # Live mount of types for pydantic->ts
|
|
- ./venv:/opt/backstory/venv:rw # Live mount for python venv
|
|
cap_add: # used for running ze-monitor within container
|
|
- CAP_DAC_READ_SEARCH # Bypass all filesystem read access checks
|
|
- CAP_PERFMON # Access to perf_events (vs. overloaded CAP_SYS_ADMIN)
|
|
- CAP_SYS_PTRACE # PTRACE_MODE_READ_REALCREDS ptrace access mode check
|
|
|
|
backstory-prod:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: backstory-prod
|
|
#image: backstory
|
|
container_name: backstory-prod
|
|
restart: "always"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- PRODUCTION=1
|
|
- FRONTEND_URL=https://backstory.ketrenos.com
|
|
- MODEL_NAME=${MODEL_NAME:-qwen2.5:7b}
|
|
- REDIS_URL=redis://redis:6379
|
|
- REDIS_DB=1
|
|
- SSL_ENABLED=false
|
|
devices:
|
|
- /dev/dri:/dev/dri
|
|
depends_on:
|
|
- ollama
|
|
- redis
|
|
networks:
|
|
- internal
|
|
ports:
|
|
- 8911:8911 # FastAPI React server
|
|
volumes:
|
|
- ./cache:/root/.cache # Persist all models and GPU kernel cache
|
|
- ./chromadb-prod:/opt/backstory/chromadb:rw # Persist ChromaDB
|
|
- ./sessions-prod:/opt/backstory/sessions:rw # Persist sessions
|
|
- ./docs-prod:/opt/backstory/docs:rw # Live mount of RAG content
|
|
- ./users-prod:/opt/backstory/users:rw # Live mount of user data
|
|
- ./frontend/deployed:/opt/backstory/frontend/deployed:ro # Live mount built frontend
|
|
cap_add: # used for running ze-monitor within container
|
|
- CAP_DAC_READ_SEARCH # Bypass all filesystem read access checks
|
|
- CAP_PERFMON # Access to perf_events (vs. overloaded CAP_SYS_ADMIN)
|
|
- CAP_SYS_PTRACE # PTRACE_MODE_READ_REALCREDS ptrace access mode check
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: redis
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis_data:/data
|
|
- ./redis.conf:/usr/local/etc/redis/redis.conf
|
|
command: redis-server /usr/local/etc/redis/redis.conf
|
|
networks:
|
|
- internal
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Optional: Redis Commander for GUI management
|
|
redis-commander:
|
|
image: rediscommander/redis-commander:latest
|
|
container_name: redis-commander
|
|
ports:
|
|
- "8081:8081"
|
|
environment:
|
|
- REDIS_HOSTS=redis:redis:6379
|
|
networks:
|
|
- internal
|
|
depends_on:
|
|
- redis
|
|
profiles:
|
|
- tools # Only start with --profile tools
|
|
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: frontend
|
|
container_name: frontend
|
|
#image: frontend
|
|
restart: "always"
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- 3000:3000 # REACT expo while developing frontend
|
|
volumes:
|
|
- ./frontend:/opt/backstory/frontend:rw # Live mount frontend src
|
|
networks:
|
|
- internal
|
|
|
|
# This doesn't work...
|
|
# ollama-intel:
|
|
# image: intelanalytics/ipex-llm-inference-cpp-xpu:latest
|
|
# container_name: ollama-intel
|
|
# restart: unless-stopped
|
|
# env_file:
|
|
# - .env
|
|
# devices:
|
|
# - /dev/dri:/dev/dri
|
|
# volumes:
|
|
# - ./cache:/root/.cache # Cache hub models and neo_compiler_cache
|
|
# - ./ollama:/root/.ollama # Cache the ollama models
|
|
# ports:
|
|
# - 11434:11434
|
|
# environment:
|
|
# - OLLAMA_HOST=0.0.0.0
|
|
# - DEVICE=Arc
|
|
# - OLLAMA_INTEL_GPU=true
|
|
# - OLLAMA_NUM_GPU=999
|
|
# - ZES_ENABLE_SYSMAN=1
|
|
# - ONEAPI_DEVICE_SELECTOR=level_zero:0
|
|
# - TZ=America/Los_Angeles
|
|
# command: sh -c 'mkdir -p /llm/ollama && cd /llm/ollama && init-ollama && exec ./ollama serve'
|
|
|
|
ollama:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: ollama
|
|
container_name: ollama
|
|
restart: "always"
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- OLLAMA_HOST=0.0.0.0
|
|
- ONEAPI_DEVICE_SELECTOR=level_zero:0
|
|
devices:
|
|
- /dev/dri:/dev/dri
|
|
ports:
|
|
- 11434:11434 # ollama serve port
|
|
networks:
|
|
- internal
|
|
volumes:
|
|
- ./cache:/root/.cache # Cache hub models and neo_compiler_cache
|
|
- ./ollama:/root/.ollama # Cache the ollama models
|
|
cap_add: # used for running ze-monitor within container
|
|
- CAP_DAC_READ_SEARCH # Bypass all filesystem read access checks
|
|
- CAP_PERFMON # Access to perf_events (vs. overloaded CAP_SYS_ADMIN)
|
|
- CAP_SYS_PTRACE # PTRACE_MODE_READ_REALCREDS ptrace access mode check
|
|
|
|
jupyter:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: jupyter
|
|
#image: jupyter
|
|
container_name: jupyter
|
|
restart: "always"
|
|
env_file:
|
|
- .env
|
|
devices:
|
|
- /dev/dri:/dev/dri
|
|
depends_on:
|
|
- ollama
|
|
- miniircd
|
|
ports:
|
|
- 8888:8888 # Jupyter Notebook
|
|
- 60673:60673 # Gradio
|
|
networks:
|
|
- internal
|
|
volumes:
|
|
- ./jupyter:/opt/jupyter:rw
|
|
- ./cache:/root/.cache
|
|
|
|
miniircd:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
target: miniircd
|
|
#image: miniircd
|
|
container_name: miniircd
|
|
restart: "no"
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- 6667:6667 # IRC
|
|
networks:
|
|
- internal
|
|
volumes:
|
|
- ./cache:/root/.cache
|
|
|
|
prometheus:
|
|
image: prom/prometheus
|
|
container_name: prometheus
|
|
restart: "always"
|
|
ports:
|
|
- 9090:9090 # Prometheus
|
|
networks:
|
|
- internal
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- ./cache/prometheus:/prometheus
|
|
|
|
grafana:
|
|
image: grafana/grafana-oss
|
|
container_name: grafana
|
|
restart: "always"
|
|
env_file:
|
|
- .env.grafana
|
|
ports:
|
|
- 3111:3000 # Grafana
|
|
networks:
|
|
- internal
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- ./cache/grafana:/var/lib/grafana
|
|
|
|
|
|
# loki:
|
|
# image: grafana/loki
|
|
# container_name: loki
|
|
# restart: "always"
|
|
# # env_file:
|
|
# # - .env.grafana
|
|
# ports:
|
|
# - 3211:3100 # Grafana
|
|
# networks:
|
|
# - internal
|
|
# command:
|
|
# - -config.file=/loki-config.yaml
|
|
# volumes:
|
|
# # - ./prometheus.yml:/etc/prometheus/prometheus.yml
|
|
# - ./loki-config.yaml:/loki-config.yaml
|
|
# - ./cache/loki:/loki
|
|
|
|
|
|
networks:
|
|
internal:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
redis_data:
|
|
driver: local
|
|
|