Repository navigation
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
139 lines (130 loc) · 4.01 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
139 lines (130 loc) · 4.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
# Production — immutable images, no bind mounts, secrets via env_file pointing at
# deploy-time secret files (ADR-008). Postgres, ai-service, indexer-service, neo4j,
# and redis are never exposed on the host — only reachable on the internal Docker
# network. api/web ports ARE exposed directly so an externally-managed reverse proxy
# (set up separately, outside this repo) can route to them.
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
env_file: ./secrets/postgres.env
volumes:
- postgres_data_prod:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 10
# No `ports:` — reachable only on the internal network
neo4j:
image: neo4j:5-community
restart: unless-stopped
environment:
- NEO4J_AUTH=neo4j/${NEO4J_PASSWORD:-archadi_prod_neo4j_sec_88492019384729182}
- NEO4J_server_memory_heap_initial__size=256m
- NEO4J_server_memory_heap_max__size=512m
- NEO4J_server_memory_pagecache_size=256m
volumes:
- neo4j_data_prod:/data
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
# No `ports:` — reachable only on the internal network
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- redis_data_prod:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# No `ports:` — reachable only on the internal network
ai-service:
build:
context: ./apps/ai-service
dockerfile: Dockerfile
target: prod
restart: unless-stopped
env_file: ./secrets/ai-service.env
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 15s
timeout: 5s
retries: 5
# No `ports:` — reachable only from `api` on the internal network
indexer-service:
build:
context: ./apps/indexer-service
dockerfile: Dockerfile
target: prod
restart: unless-stopped
env_file: ./secrets/indexer-service.env
depends_on:
neo4j:
condition: service_healthy
volumes:
- indexer_tmp_prod:/tmp/repos
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 15s
timeout: 5s
retries: 5
# No `ports:` — reachable only from `api` on the internal network
api:
build:
context: ./apps/api
dockerfile: Dockerfile
target: prod
restart: unless-stopped
env_file: ./secrets/api.env
environment:
# Required: we self-host Inngest via `inngest dev`, not Inngest Cloud.
# Without this, the SDK rejects the dev server's sync requests (PUT 400:
# "Expected server kind cloud, got dev") and functions never register.
# Setting http://inngest:8288 also ensures inngest.send() routes events
# to the inngest container rather than defaulting to 127.0.0.1:8288.
- INNGEST_DEV=http://inngest:8288
- INNGEST_BASE_URL=http://inngest:8288
ports:
- "${API_PORT:-4050}:4000"
depends_on:
postgres:
condition: service_healthy
ai-service:
condition: service_healthy
indexer-service:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
interval: 15s
timeout: 5s
retries: 5
web:
build:
context: ./apps/web
dockerfile: Dockerfile
target: prod
restart: unless-stopped
env_file: ./secrets/web.env
ports:
- "${WEB_PORT:-3050}:3000"
depends_on:
- api
inngest:
image: inngest/inngest:latest
restart: unless-stopped
command: inngest dev -u http://api:4000/api/inngest
depends_on:
- api
volumes:
postgres_data_prod:
neo4j_data_prod:
redis_data_prod:
indexer_tmp_prod: