forked from HKUDS/DeepTutor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.ghcr.yml
More file actions
108 lines (100 loc) · 4.55 KB
/
Copy pathdocker-compose.ghcr.yml
File metadata and controls
108 lines (100 loc) · 4.55 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# ============================================
# DeepTutor Docker Compose — Pre-built GHCR Image
# ============================================
# Run DeepTutor using the official pre-built image from GitHub Container Registry.
# No local build required — the image is pulled automatically.
#
# Usage:
# python scripts/docker_compose.py -f docker-compose.ghcr.yml up -d
#
# To pin a specific version:
# Edit the image tag below, e.g. ghcr.io/hkuds/deeptutor:1.0.0
#
# Prerequisites:
# 1. Configure providers in data/user/settings/model_catalog.json or the UI
# 2. Use scripts/docker_compose.py so port mappings are rendered from system.json
# 3. Read the API URL note below before starting
#
# Local LLM (LM Studio / Ollama / vLLM):
# Use "host.docker.internal" instead of "localhost" in provider base_url fields.
# Configure provider endpoints in data/user/settings/model_catalog.json or the UI.
#
# ============================================
# IMPORTANT: Frontend-to-Backend API URL
# ============================================
# The frontend (Next.js) runs entirely in the user's browser — not in the container.
# This means "localhost" in the browser refers to the USER'S MACHINE, not the Docker host.
#
# LOCAL deployment (Docker on the same machine you browse from):
# Leave system.next_public_api_base_external blank. The default http://localhost:8001 works
# because Docker maps port 8001 from the container to your local machine.
#
# REMOTE SERVER deployment (Docker on a server, accessed from another machine):
# Set system.next_public_api_base_external to your server's public IP or hostname, e.g.:
# "next_public_api_base_external": "http://203.0.113.10:8001"
# Without this, the browser will try to reach localhost:8001 on the USER'S laptop
# (not the server), and all API calls will fail.
# ============================================
services:
# Internal-only Redis for multi-worker turn coordination. It is deliberately
# not published to the host; configure redis_url as redis://redis:6379/0.
redis:
image: redis:7.4-alpine
container_name: deeptutor-redis
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes", "--appendfsync", "everysec"]
volumes:
- ./data/redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
networks:
- deeptutor-network
deeptutor:
image: ghcr.io/hkuds/deeptutor:latest
pull_policy: always
container_name: deeptutor
restart: unless-stopped
ports:
- "${DEEPTUTOR_DOCKER_BACKEND_PORT:-8001}:${DEEPTUTOR_DOCKER_BACKEND_PORT:-8001}"
- "${DEEPTUTOR_DOCKER_FRONTEND_PORT:-3782}:${DEEPTUTOR_DOCKER_FRONTEND_PORT:-3782}"
volumes:
# Persist every workspace and deployment secret across recreation.
# This used to mount only data/user, data/memory and data/knowledge_bases,
# which left data/system (auth secret, accounts, grants, per-owner Codex
# tokens), data/users, data/partners and data/cli-apps in the container's
# writable layer — discarded on every recreate. Upgrading from that
# layout needs a one-time copy out of the running container first; see
# CONTAINERIZATION.md → "One-time migration".
- ./data:/app/data
# Optional dependencies, re-applied on every start (#762). This image
# ships the base install; anything added with `docker exec … pip install`
# or `apt-get install` lives in the container's writable layer and is
# discarded on the next `compose down`. Declaring it here instead makes it
# a property of the deployment, so every container started from this file
# has it. Both steps are idempotent (a warm container only pays a check)
# and neither is fatal — a package that fails to install leaves that one
# feature unavailable rather than stopping the app. The pip cache lives on
# the data volume above, so a recreate reuses the downloads it already
# paid for. Preview an extra with
# `python scripts/install_extras.py --dry-run "<name>"`. Uncomment the
# `environment:` key together with the entries under it.
# environment:
# - DEEPTUTOR_EXTRAS=math-animator,partners
# - DEEPTUTOR_APT_PACKAGES=ffmpeg
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${DEEPTUTOR_DOCKER_BACKEND_PORT:-8001}/health/ready"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
depends_on:
redis:
condition: service_healthy
networks:
- deeptutor-network
networks:
deeptutor-network:
driver: bridge