-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
151 lines (145 loc) · 5.99 KB
/
Copy pathdocker-compose.yml
File metadata and controls
151 lines (145 loc) · 5.99 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# EfficientAI Docker Compose
#
# Usage:
# docker compose up # Uses latest images
# EFFICIENTAI_VERSION=1.0.0 docker compose up # Uses specific version
#
# For local development, uncomment the 'build' sections below.
services:
db:
image: postgres:15
container_name: efficientai_db
environment:
POSTGRES_USER: ${POSTGRES_USER:-efficientai}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-efficientai}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-efficientai}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: efficientai_redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
api:
# Pre-built image from GitHub Container Registry
# Use EFFICIENTAI_VERSION env var to pin to a specific version (e.g., 1.0.0)
image: ghcr.io/efficientai-tech/efficientai-api:${EFFICIENTAI_VERSION:-latest}
# For local development, uncomment below and comment out the image line:
build:
context: .
dockerfile: docker/Dockerfile.api
container_name: efficientai_api
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-efficientai}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-efficientai}
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
SECRET_KEY: ${SECRET_KEY:-your-secret-key-change-in-production}
UPLOAD_DIR: /app/uploads
DEBUG: ${DEBUG:-True}
FRONTEND_DIR: /app/frontend/dist
ENCRYPTION_KEY: ${ENCRYPTION_KEY:-}
# Optional GCS blob storage (set storage.blob_provider: gcs in config.docker.yml):
# BLOB_STORAGE_PROVIDER: gcs
# GCS_BUCKET_NAME: your-gcs-bucket
# GCS_PROJECT_ID: your-gcp-project
# GOOGLE_APPLICATION_CREDENTIALS: /app/secrets/gcp-sa.json
# Optional Azure Blob Storage (set storage.blob_provider: azure in config.docker.yml):
# BLOB_STORAGE_PROVIDER: azure
# AZURE_BLOB_ENABLED: "true"
# AZURE_CONNECTION_STRING: DefaultEndpointsProtocol=https;AccountName=...
# AZURE_CONTAINER_NAME: your-container
volumes:
- ./uploads:/app/uploads
- ./.data:/app/.data
- ./config.docker.yml:/app/config.yml:ro
# Optional: mount GCP service account for GCS auth
# - ./secrets/gcp-sa.json:/app/secrets/gcp-sa.json:ro
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: eai start --config /app/config.yml --host 0.0.0.0 --port 8000 --no-build-frontend --no-reload
worker:
# Pre-built image from GitHub Container Registry
# Use EFFICIENTAI_VERSION env var to pin to a specific version (e.g., 1.0.0)
image: ghcr.io/efficientai-tech/efficientai-worker:${EFFICIENTAI_VERSION:-latest}
# For local development, uncomment below and comment out the image line:
build:
context: .
dockerfile: docker/Dockerfile.worker
args:
INSTALL_EXTRAS: "qualitative-voice"
container_name: efficientai_worker
environment:
# Worker uses Docker network, so it reaches DB/Redis via service names
DATABASE_URL: postgresql://${POSTGRES_USER:-efficientai}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-efficientai}
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
ENCRYPTION_KEY: ${ENCRYPTION_KEY:-}
# Optional GCS blob storage (match api service env when using gcs):
# GOOGLE_APPLICATION_CREDENTIALS: /app/secrets/gcp-sa.json
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./uploads:/app/uploads
- ./.data:/app/.data
- ./config.docker.yml:/app/config.yml:ro
# Optional: mount GCP service account for GCS auth
# - ./secrets/gcp-sa.json:/app/secrets/gcp-sa.json:ro
command: eai worker --config /app/config.yml --loglevel info --queues celery,audio-metrics --concurrency 8
# Dedicated worker for call-import + evaluation queues. Celery drains
# ``imports`` (recording fetch) before ``diarization`` (manual diarise),
# then ``evaluations`` (LLM scoring). Fair eval dispatch + eval
# materialize run on the ``celery`` queue (``worker`` service) so a large
# import/eval fan-out in one workspace cannot head-of-line block dispatch
# for other workspaces.
worker-imports:
image: ghcr.io/efficientai-tech/efficientai-worker:${EFFICIENTAI_VERSION:-latest}
build:
context: .
dockerfile: docker/Dockerfile.worker
args:
INSTALL_EXTRAS: ""
container_name: efficientai_worker_imports
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-efficientai}:${POSTGRES_PASSWORD:-password}@db:5432/${POSTGRES_DB:-efficientai}
REDIS_URL: redis://redis:6379/0
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
ENCRYPTION_KEY: ${ENCRYPTION_KEY:-}
# Optional GCS blob storage (match api service env when using gcs):
# GOOGLE_APPLICATION_CREDENTIALS: /app/secrets/gcp-sa.json
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./uploads:/app/uploads
- ./.data:/app/.data
- ./config.docker.yml:/app/config.yml:ro
# Optional: mount GCP service account for GCS auth
# - ./secrets/gcp-sa.json:/app/secrets/gcp-sa.json:ro
command: eai worker --config /app/config.yml --loglevel info --queues imports,diarization,evaluations --pool threads --concurrency 32
volumes:
postgres_data: