-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
172 lines (164 loc) · 4.32 KB
/
docker-compose.yml
File metadata and controls
172 lines (164 loc) · 4.32 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
version: '3.8'
services:
postgres:
image: pgvector/pgvector:pg16
container_name: codechunking-postgres
environment:
- POSTGRES_DB=codechunking
- POSTGRES_USER=dev
- POSTGRES_PASSWORD=dev
ports:
- "5432:5432"
volumes:
#- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dev -d codechunking"]
interval: 10s
timeout: 5s
retries: 5
networks:
- codechunking-network
nats:
image: nats:2.10-alpine
container_name: codechunking-nats
command: ["--jetstream", "--store_dir", "/data", "--http_port", "8222"]
ports:
- "4222:4222" # Client connections
- "8222:8222" # HTTP monitoring
volumes:
- nats_data:/data
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "4222"]
interval: 10s
timeout: 5s
retries: 5
networks:
- codechunking-network
pgadmin:
image: dpage/pgadmin4:latest
container_name: codechunking-pgadmin
environment:
- PGADMIN_DEFAULT_EMAIL=admin@example.com
- PGADMIN_DEFAULT_PASSWORD=admin
- PGADMIN_CONFIG_SERVER_MODE=False
ports:
- "5050:80"
depends_on:
- postgres
networks:
- codechunking-network
profiles:
- tools
zoekt-webserver:
build:
context: .
dockerfile: docker/Dockerfile.zoekt
container_name: codechunking-zoekt-webserver
command: ["-index", "/data/index", "-pprof", "-rpc"] # HTTP on 6070, gRPC on 6071
ports:
- name: zoekt-http
target: 6070
published: "6070"
protocol: tcp
- name: zoekt-grpc
target: 6071
published: "6071"
protocol: tcp
volumes:
- zoekt_data:/data/index
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:6070/healthz || exit 1"]
interval: 10s
timeout: 5s
retries: 3
networks:
- codechunking-network
api:
build:
context: .
dockerfile: docker/Dockerfile
container_name: codechunking-api
depends_on:
- postgres
- nats
environment:
- CODECHUNK_DATABASE_HOST=postgres
- CODECHUNK_DATABASE_USER=dev
- CODECHUNK_DATABASE_PASSWORD=dev
- CODECHUNK_NATS_URL=nats://nats:4222
- CODECHUNK_GEMINI_API_KEY=${CODECHUNK_GEMINI_API_KEY}
- GITLAB_TOKEN=${GITLAB_TOKEN}
ports:
- "8080:8080"
command: ["api", "--config", "configs/config.dev.yaml"]
restart: unless-stopped
networks:
- codechunking-network
develop:
watch:
# Rebuild on Go source changes
- action: rebuild
path: .
target: /app
ignore:
- "**/*.md"
- "**/*_test.go"
- ".git/"
- "wiki/"
# Sync config changes without rebuild
- action: sync+restart
path: ./configs
target: /app/configs
# Sync migrations without rebuild
- action: sync+restart
path: ./migrations
target: /app/migrations
worker:
build:
context: .
dockerfile: docker/Dockerfile
container_name: codechunking-worker
depends_on:
- postgres
- nats
- zoekt-webserver
environment:
- CODECHUNK_DATABASE_HOST=postgres
- CODECHUNK_DATABASE_USER=dev
- CODECHUNK_DATABASE_PASSWORD=dev
- CODECHUNK_NATS_URL=nats://nats:4222
- CODECHUNK_GEMINI_API_KEY=${CODECHUNK_GEMINI_API_KEY}
- GITLAB_TOKEN=${GITLAB_TOKEN}
command: ["worker", "--config", "configs/config.dev.yaml"]
restart: unless-stopped
volumes:
- zoekt_data:/data/index
networks:
- codechunking-network
develop:
watch:
# Rebuild on Go source changes
- action: rebuild
path: .
target: /app
ignore:
- "**/*.md"
- "**/*_test.go"
- ".git/"
- "wiki/"
# Sync config changes without rebuild
- action: sync+restart
path: ./configs
target: /app/configs
# Sync migrations without rebuild
- action: sync+restart
path: ./migrations
target: /app/migrations
volumes:
postgres_data:
nats_data:
zoekt_data:
networks:
codechunking-network:
driver: bridge