-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.app.yml
More file actions
85 lines (81 loc) · 2.87 KB
/
Copy pathdocker-compose.app.yml
File metadata and controls
85 lines (81 loc) · 2.87 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
# One-command full application stack — Postgres + gateway + admin-ui.
#
# docker compose -f docker-compose.app.yml up --build
#
# Brings up:
# - postgres :5432 pgvector; rag_corpus_store created by infra/postgres/init.sql
# - gateway :8000 built with the `backends` extra; corpus_store=postgres
# - admin-ui :3100 live console (gateway URL baked to http://localhost:8000)
#
# Corpora created in the console (POST /v1/corpora) persist to Postgres and
# survive `down`/`up`. Query/retrieve return empty — no vector store/LLM is
# wired (see infra/rag.docker.yaml); this stack demonstrates corpus persistence.
#
# NOTE: this binds host :5433(pg)/:8000/:3100. Run this OR the dev stack
# (docker-compose.yml --profile core), not both at once — they share ports.
# A distinct project name + volume keep its data separate from the dev stack.
name: acos-app
services:
postgres:
image: pgvector/pgvector:pg16
container_name: acos-app-postgres
environment:
POSTGRES_USER: rag
POSTGRES_PASSWORD: rag
POSTGRES_DB: rag
ports:
# Host 5433 (a native PostgreSQL is commonly already on :5432); the
# gateway reaches Postgres over the compose network at postgres:5432,
# so the internal port is unchanged and only host access moves.
- "5433:5432"
volumes:
- acos_app_pg:/var/lib/postgresql/data
- ./infra/postgres/init.sql:/docker-entrypoint-initdb.d/01_init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rag"]
interval: 5s
timeout: 5s
retries: 5
gateway:
build:
context: .
dockerfile: Dockerfile
args:
GATEWAY_EXTRAS: backends # install rag-backends (Postgres corpus store)
container_name: acos-app-gateway
depends_on:
postgres:
condition: service_healthy
environment:
RAG_CONFIG_PATH: /app/config/rag.yaml
# OpenAI key for the embedder + LLM (rag.docker.yaml selects openai). Loaded
# from .env.openai if present (gitignored); the stack still boots without it
# (only the query/ingest OpenAI calls would then fail).
env_file:
- path: .env.openai
required: false
volumes:
- ./infra/rag.docker.yaml:/app/config/rag.yaml:ro
ports:
- "8000:8000"
healthcheck:
# python is the only interpreter in the slim runtime image (no curl).
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/healthz')"]
interval: 5s
timeout: 5s
retries: 10
admin-ui:
build:
context: .
dockerfile: apps/admin-ui/Dockerfile
args:
# Browser-facing URL (the client calls it from the host), baked at build.
NEXT_PUBLIC_GATEWAY_URL: http://localhost:8000
container_name: acos-app-admin-ui
depends_on:
gateway:
condition: service_healthy
ports:
- "3100:3100"
volumes:
acos_app_pg: