-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathdocker-compose.git-context.yml
More file actions
75 lines (68 loc) · 3.03 KB
/
docker-compose.git-context.yml
File metadata and controls
75 lines (68 loc) · 3.03 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
# =============================================================================
# Docker Compose for Git-based Context
# =============================================================================
# This example shows how to deploy nao with context loaded from a git repository.
# No volume mount is required - the container clones the context on startup.
#
# Usage:
# docker-compose -f docker-compose.git-context.yml up -d
#
# Prerequisites:
# 1. Create a git repo with your nao context (nao_config.yaml, databases/, etc.)
# 2. Set up CI/CD to run `nao sync` and commit results
# 3. Create a .env file with your secrets
#
# =============================================================================
services:
postgres:
image: postgres:16-alpine
container_name: nao_chat_postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-nao}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nao}
POSTGRES_DB: ${POSTGRES_DB:-nao}
ports:
- '8888:5432'
volumes:
- nao_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-nao} -d ${POSTGRES_DB:-nao}']
interval: 5s
timeout: 5s
retries: 5
nao:
build:
context: .
dockerfile: Dockerfile
ports:
- '${SERVER_PORT:-5005}:${SERVER_PORT:-5005}'
environment:
# =================================================================
# Chat Port
# =================================================================
SERVER_PORT: ${SERVER_PORT:-5005}
# =================================================================
# Authentication & API Keys
# =================================================================
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET}
OPENAI_API_KEY: ${OPENAI_API_KEY}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
GOOGLE_APPLICATION_CREDENTIALS_JSON: ${GOOGLE_APPLICATION_CREDENTIALS_JSON}
# =================================================================
# Database for nao chat history
# =================================================================
DB_URI: postgres://${POSTGRES_USER:-nao}:${POSTGRES_PASSWORD:-nao}@postgres:5432/${POSTGRES_DB:-nao}
# =================================================================
# Git-based Context Configuration
# =================================================================
NAO_CONTEXT_SOURCE: git
NAO_CONTEXT_GIT_URL: ${NAO_CONTEXT_GIT_URL}
NAO_CONTEXT_GIT_BRANCH: ${NAO_CONTEXT_GIT_BRANCH:-main}
NAO_CONTEXT_GIT_TOKEN: ${NAO_CONTEXT_GIT_TOKEN}
NAO_DEFAULT_PROJECT_PATH: /app/context
# Refresh context every hour (git pull)
NAO_REFRESH_SCHEDULE: '0 * * * *'
depends_on:
- postgres
volumes:
nao_postgres_data: