Repository navigation
Expand file tree
/
Copy pathdocker-compose.bundle.yml
More file actions
214 lines (202 loc) · 7.01 KB
/
Copy pathdocker-compose.bundle.yml
File metadata and controls
214 lines (202 loc) · 7.01 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# docker-compose.bundle.yml
#
# The protea-bundle. A single self-contained compose file that brings up
# the full PROTEA stack for local smoke runs from pre-built images
# published on ghcr.io (no local build context required).
#
# Use it when you want to reproduce the production-shaped wiring on a
# laptop without cloning every plugin repo or running `manage.sh`.
#
# Quick start:
# docker compose -f docker-compose.bundle.yml --env-file .env.bundle up -d
# curl -s http://localhost:8000/health # {"status":"ok"}
# docker compose -f docker-compose.bundle.yml down -v
#
# Companion files:
# - .env.bundle.example sample env (copy to .env.bundle)
# - docker/init.sql postgres bootstrap (enables pgvector)
# - docker/README.md full quickstart + smoke recipe
#
# Differences vs docker-compose.yml + docker-compose.prod.yml:
# - Standalone (no second `-f` override), self-documenting service set.
# - Pulls ghcr.io/frapercan/protea images by tag, no local Dockerfile build.
# - Trimmed worker set (one per logical queue family) so the bundle fits
# comfortably on a 16 GB laptop. The full prod set lives in
# docker-compose.yml + docker-compose.prod.yml.
# - Explicit network so monitoring stacks can attach via external network.
name: protea-bundle
services:
postgres:
image: pgvector/pgvector:pg16
container_name: protea-bundle-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-protea}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-protea}
POSTGRES_DB: ${POSTGRES_DB:-protea}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-protea} -d ${POSTGRES_DB:-protea}"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
networks:
- protea-bundle
deploy:
resources:
limits:
memory: 2G
rabbitmq:
image: rabbitmq:3-management
container_name: protea-bundle-rabbitmq
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS:-guest}
ports:
- "${RABBITMQ_PORT:-5672}:5672"
- "${RABBITMQ_MGMT_PORT:-15672}:15672"
# rabbitmq_prometheus plugin metrics endpoint.
- "${RABBITMQ_PROMETHEUS_PORT:-15692}:15692"
volumes:
- ./docker/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
networks:
- protea-bundle
deploy:
resources:
limits:
memory: 768M
migrate:
image: ghcr.io/frapercan/protea:${PROTEA_IMAGE_TAG:-latest}
container_name: protea-bundle-migrate
environment:
PROTEA_DB_URL: postgresql+psycopg://${POSTGRES_USER:-protea}:${POSTGRES_PASSWORD:-protea}@postgres:5432/${POSTGRES_DB:-protea}
PROTEA_AMQP_URL: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASS:-guest}@rabbitmq:5672/
PROTEA_STORAGE_BACKEND: local
command: alembic upgrade head
depends_on:
postgres:
condition: service_healthy
restart: "no"
networks:
- protea-bundle
api:
image: ghcr.io/frapercan/protea:${PROTEA_IMAGE_TAG:-latest}
container_name: protea-bundle-api
environment:
PROTEA_DB_URL: postgresql+psycopg://${POSTGRES_USER:-protea}:${POSTGRES_PASSWORD:-protea}@postgres:5432/${POSTGRES_DB:-protea}
PROTEA_AMQP_URL: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASS:-guest}@rabbitmq:5672/
PROTEA_STORAGE_BACKEND: local
PROTEA_ADMIN_TOKEN: ${PROTEA_ADMIN_TOKEN:-protea-admin}
PROTEA_ALLOWED_ORIGINS: ${PROTEA_ALLOWED_ORIGINS:-http://localhost:3000}
ports:
- "${PROTEA_API_PORT:-8000}:8000"
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request,sys;sys.exit(0 if urllib.request.urlopen('http://localhost:8000/health',timeout=3).status==200 else 1)"]
interval: 15s
timeout: 5s
retries: 10
start_period: 30s
networks:
- protea-bundle
deploy:
resources:
limits:
memory: 1G
worker-jobs:
image: ghcr.io/frapercan/protea:${PROTEA_IMAGE_TAG:-latest}
container_name: protea-bundle-worker-jobs
environment:
PROTEA_DB_URL: postgresql+psycopg://${POSTGRES_USER:-protea}:${POSTGRES_PASSWORD:-protea}@postgres:5432/${POSTGRES_DB:-protea}
PROTEA_AMQP_URL: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASS:-guest}@rabbitmq:5672/
PROTEA_STORAGE_BACKEND: local
command: python scripts/worker.py --queue protea.jobs
depends_on:
migrate:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
networks:
- protea-bundle
deploy:
resources:
limits:
memory: 1G
worker-ping:
image: ghcr.io/frapercan/protea:${PROTEA_IMAGE_TAG:-latest}
container_name: protea-bundle-worker-ping
environment:
PROTEA_DB_URL: postgresql+psycopg://${POSTGRES_USER:-protea}:${POSTGRES_PASSWORD:-protea}@postgres:5432/${POSTGRES_DB:-protea}
PROTEA_AMQP_URL: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASS:-guest}@rabbitmq:5672/
PROTEA_STORAGE_BACKEND: local
command: python scripts/worker.py --queue protea.ping
depends_on:
migrate:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
networks:
- protea-bundle
deploy:
resources:
limits:
memory: 512M
worker-embeddings:
image: ghcr.io/frapercan/protea:${PROTEA_IMAGE_TAG:-latest}
container_name: protea-bundle-worker-embeddings
environment:
PROTEA_DB_URL: postgresql+psycopg://${POSTGRES_USER:-protea}:${POSTGRES_PASSWORD:-protea}@postgres:5432/${POSTGRES_DB:-protea}
PROTEA_AMQP_URL: amqp://${RABBITMQ_USER:-guest}:${RABBITMQ_PASS:-guest}@rabbitmq:5672/
PROTEA_STORAGE_BACKEND: local
command: python scripts/worker.py --queue protea.embeddings
depends_on:
migrate:
condition: service_completed_successfully
rabbitmq:
condition: service_healthy
networks:
- protea-bundle
deploy:
resources:
limits:
memory: 2G
web:
image: ghcr.io/frapercan/protea-frontend:${PROTEA_FRONTEND_TAG:-latest}
container_name: protea-bundle-web
environment:
PROTEA_API_URL: http://api:8000
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-/api-proxy}
ports:
- "${PROTEA_WEB_PORT:-3000}:3000"
depends_on:
api:
condition: service_healthy
networks:
- protea-bundle
deploy:
resources:
limits:
memory: 512M
networks:
protea-bundle:
name: protea-bundle
driver: bridge
volumes:
postgres_data:
name: protea-bundle-postgres-data