-
Notifications
You must be signed in to change notification settings - Fork 542
/
Copy pathdocker-compose.yaml
771 lines (743 loc) · 26.2 KB
/
docker-compose.yaml
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
version: '2.4'
services:
# Description: This container will migrate the Postgres `frontend`,
# `codeintel`, and `codeinsights` databases
#
# Disk: None
# Ports: None
#
# This container should start after the database instance starts, perform the migrations
# and then exit cleanly. After exiting the `frontend` service is allowed to start.
#
# If you're using a DB instance hosted outside of docker-compose, the environment variables
# for this container will need to be updated to reflect the new connection information.
migrator:
container_name: migrator
image: 'index.docker.io/sourcegraph/migrator:insiders@sha256:05e820b0694f0a5008e8069a50089ebc9dc7cc464075c2c166b0ef29dba60ac5'
cpus: 0.5
mem_limit: '500m'
command:
["up"]
environment:
- PGHOST=pgsql
- PGPORT=5432
- PGUSER=sg
- PGPASSWORD=sg
- PGDATABASE=sg
- PGSSLMODE=disable
- CODEINTEL_PGHOST=codeintel-db
- CODEINTEL_PGPORT=5432
- CODEINTEL_PGUSER=sg
- CODEINTEL_PGPASSWORD=sg
- CODEINTEL_PGDATABASE=sg
- CODEINTEL_PGSSLMODE=disable
# If you are not running code insights, please see:
# https://docs.sourcegraph.com/admin/install/docker-compose/operations#database-migrations for more information
# for information on how to configure Sourcegraph migrations
- CODEINSIGHTS_PGHOST=codeinsights-db
- CODEINSIGHTS_PGPORT=5432
- CODEINSIGHTS_PGUSER=postgres
- CODEINSIGHTS_PGPASSWORD=password
- CODEINSIGHTS_PGDATABASE=postgres
- CODEINSIGHTS_PGSSLMODE=disable
restart: "on-failure"
networks:
- sourcegraph
depends_on:
pgsql:
condition: service_healthy
codeinsights-db:
condition: service_healthy
codeintel-db:
condition: service_healthy
# Description: Acts as a reverse proxy for all of the sourcegraph-frontend instances
#
# Disk: 1GB / persistent SSD
# Ports exposed to other Sourcegraph services: none
# Ports exposed to the public internet: 80 (HTTP) and 443 (HTTPS)
#
# Sourcegraph ships with a few builtin templates that cover common HTTP/HTTPS configurations:
# - HTTP only (default)
# - HTTPS with Let's Encrypt
# - HTTPS with custom certificates
#
# Follow the directions in the comments below to swap between these configurations.
#
# If none of these built-in configurations suit your needs, then you can create your own Caddyfile, see:
# https://caddyserver.com/docs/caddyfile
caddy:
container_name: caddy
image: 'index.docker.io/caddy:2.4.6-alpine@sha256:b5a59725783bab0d65803f87028c68dd6611ca6184040bd98b18797cbe26bdd9'
cpus: 4
mem_limit: '4g'
environment:
- 'XDG_DATA_HOME=/caddy-storage/data'
- 'XDG_CONFIG_HOME=/caddy-storage/config'
- 'SRC_FRONTEND_ADDRESSES=sourcegraph-frontend-0:3080'
# Uncomment & update this line when using Let's Encrypt or custom HTTPS certificates:
# - 'SRC_SITE_ADDRESS=sourcegraph.example.com'
#
# Uncomment & update the following line when using HTTPS with Let's Encrypt
# - '[email protected]'
volumes:
- 'caddy:/caddy-storage'
#
# Comment out the following line when using HTTPS with either Let's Encrypt or custom certificates
- '../caddy/builtins/http.Caddyfile:/etc/caddy/Caddyfile'
#
# Uncomment the following line when using HTTPS with Let's Encrypt's staging environment
# - '../caddy/builtins/https.lets-encrypt-staging.Caddyfile:/etc/caddy/Caddyfile'
#
# Uncomment the following line when using HTTPS with Let's Encrypt's production environment
# IMPORTANT: Strongly recommended to test with the staging configuration above first, see that file for details.
# - '../caddy/builtins/https.lets-encrypt-prod.Caddyfile:/etc/caddy/Caddyfile'
#
# Uncomment the following line when using HTTPS with custom certificates
# - '../caddy/builtins/https.custom-cert.Caddyfile:/etc/caddy/Caddyfile'
#
# Uncomment / update the following line when using HTTPS with custom certificates
# - '/LOCAL/CERT/PATH.pem:/sourcegraph.pem'
#
# Uncomment / update the following line when using HTTPS with custom certificates
# - '/LOCAL/KEY/PATH.key:/sourcegraph.key'
ports:
- '0.0.0.0:80:80'
- '0.0.0.0:443:443'
networks:
- sourcegraph
restart: always
# Description: Serves the frontend of Sourcegraph via HTTP(S).
#
# Disk: 128GB / non-persistent SSD
# Ports exposed to other Sourcegraph services: 6060/TCP, 3080 (HTTP), and/or 3443 (HTTPS)
# Ports exposed to the public internet: none
#
# Note: SRC_GIT_SERVERS, SEARCHER_URL, and SYMBOLS_URL are space-separated
# lists which each allow you to specify more container instances for scaling
# purposes. Be sure to also apply such a change here to the frontend-internal
# service.
sourcegraph-frontend-0:
container_name: sourcegraph-frontend-0
image: 'index.docker.io/sourcegraph/frontend:insiders@sha256:42bdb4d375adff51c00195d435c836f5066fe9ef15fd9c24b567c659c56c2099'
cpus: 4
mem_limit: '8g'
environment:
- DEPLOY_TYPE=docker-compose
- JAEGER_AGENT_HOST=jaeger
- PGHOST=pgsql
- CODEINTEL_PGHOST=codeintel-db
- CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@codeinsights-db:5432/postgres
- 'SRC_GIT_SERVERS=gitserver-0:3178'
- 'SRC_SYNTECT_SERVER=http://syntect-server:9238'
- 'SEARCHER_URL=http://searcher-0:3181'
- 'SYMBOLS_URL=http://symbols-0:3184'
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'REPO_UPDATER_URL=http://repo-updater:3182'
- 'GRAFANA_SERVER_URL=http://grafana:3370'
- 'JAEGER_SERVER_URL=http://jaeger:16686'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
- 'PROMETHEUS_URL=http://prometheus:9090'
healthcheck:
test: "wget -q 'http://127.0.0.1:3080/healthz' -O /dev/null || exit 1"
interval: 10s
timeout: 10s
retries: 10
start_period: 300s
volumes:
- 'sourcegraph-frontend-0:/mnt/cache'
networks:
- sourcegraph
restart: always
depends_on:
sourcegraph-frontend-internal:
condition: service_healthy
# Description: Serves the internal Sourcegraph frontend API.
#
# Disk: 128GB / non-persistent SSD
# Ports exposed to other Sourcegraph services: 3090/TCP 6060/TCP
# Ports exposed to the public internet: none
#
sourcegraph-frontend-internal:
container_name: sourcegraph-frontend-internal
image: 'index.docker.io/sourcegraph/frontend:insiders@sha256:42bdb4d375adff51c00195d435c836f5066fe9ef15fd9c24b567c659c56c2099'
cpus: 4
mem_limit: '8g'
environment:
- DEPLOY_TYPE=docker-compose
- PGHOST=pgsql
- CODEINTEL_PGHOST=codeintel-db
- CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@codeinsights-db:5432/postgres
- 'SRC_GIT_SERVERS=gitserver-0:3178'
- 'SRC_SYNTECT_SERVER=http://syntect-server:9238'
- 'SEARCHER_URL=http://searcher-0:3181'
- 'SYMBOLS_URL=http://symbols-0:3184'
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'REPO_UPDATER_URL=http://repo-updater:3182'
- 'GRAFANA_SERVER_URL=http://grafana:3000'
- 'JAEGER_SERVER_URL=http://jaeger:16686'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
- 'PROMETHEUS_URL=http://prometheus:9090'
volumes:
- 'sourcegraph-frontend-internal-0:/mnt/cache'
networks:
- sourcegraph
restart: always
healthcheck:
test: "wget -q 'http://127.0.0.1:3080/healthz' -O /dev/null || exit 1"
interval: 5s
timeout: 10s
retries: 5
start_period: 300s
depends_on:
pgsql:
condition: service_healthy
codeintel-db:
condition: service_healthy
migrator:
condition: service_completed_successfully
# Description: Stores clones of repositories to perform Git operations.
#
# Disk: 200GB / persistent SSD
# Ports exposed to other Sourcegraph services: 3178/TCP 6060/TCP
# Ports exposed to the public internet: none
#
gitserver-0:
container_name: gitserver-0
image: 'index.docker.io/sourcegraph/gitserver:insiders@sha256:21fe84d3dc706c010a4d286eef3272c88d1b996521e881805231de0b0d4f5390'
cpus: 4
mem_limit: '8g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- JAEGER_AGENT_HOST=jaeger
volumes:
- 'gitserver-0:/data/repos'
networks:
- sourcegraph
restart: always
hostname: gitserver-0
# Description: Backend for indexed text search operations.
#
# Disk: 200GB / persistent SSD
# Network: 100mbps
# Liveness probe: n/a
# Ports exposed to other Sourcegraph services: 6072/TCP
# Ports exposed to the public internet: none
#
zoekt-indexserver-0:
container_name: zoekt-indexserver-0
image: 'index.docker.io/sourcegraph/search-indexer:insiders@sha256:461625546e3636a1abd38b94b3accea6b8d1ae92924b738cc7b41f5e8f74bb45'
cpus: 2
mem_limit: '4g'
environment:
- 'HOSTNAME=zoekt-webserver-0:6070'
- 'SRC_FRONTEND_INTERNAL=http://sourcegraph-frontend-internal:3090'
volumes:
- 'zoekt-0-shared:/data/index'
networks:
- sourcegraph
restart: always
hostname: zoekt-indexserver-0
# Description: Backend for indexed text search operations.
#
# Disk: 200GB / persistent SSD
# Ports exposed to other Sourcegraph services: 6070/TCP
# Ports exposed to the public internet: none
#
zoekt-webserver-0:
container_name: zoekt-webserver-0
image: 'index.docker.io/sourcegraph/indexed-searcher:insiders@sha256:9d7f9a49ba16dae3c2e0ae27972b02421d65c60682ea107633dac6ab286228fb'
cpus: 2
mem_limit: '4g'
environment:
- 'HOSTNAME=zoekt-webserver-0:6070'
healthcheck:
test: "wget -q 'http://127.0.0.1:6070/healthz' -O /dev/null || exit 1"
interval: 5s
timeout: 10s
retries: 3
volumes:
- 'zoekt-0-shared:/data/index'
networks:
- sourcegraph
restart: always
hostname: zoekt-webserver-0
# Description: Backend for text search operations.
#
# Disk: 128GB / non-persistent SSD
# Ports exposed to other Sourcegraph services: 3181/TCP 6060/TCP
# Ports exposed to the public internet: none
#
searcher-0:
container_name: searcher-0
image: 'index.docker.io/sourcegraph/searcher:insiders@sha256:936192a6308c409db340fa13c4872cc6facab02247c3b3d6fea773ec64fc87ea'
cpus: 2
mem_limit: '2g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- JAEGER_AGENT_HOST=jaeger
healthcheck:
test: "wget -q 'http://127.0.0.1:3181/healthz' -O /dev/null || exit 1"
interval: 5s
timeout: 10s
retries: 3
volumes:
- 'searcher-0:/mnt/cache'
networks:
- sourcegraph
restart: always
# Description: Rate-limiting proxy for the GitHub API.
#
# CPU: 1
# Memory: 1GB
# Disk: 1GB / non-persistent SSD (only for read-only config file)
# Ports exposed to other Sourcegraph services: 3180/TCP 6060/TCP
# Ports exposed to the public internet: none
#
github-proxy:
container_name: github-proxy
image: 'index.docker.io/sourcegraph/github-proxy:insiders@sha256:1ee9534f48d4855a429a2611bf1ebbfe40f3dd9d7a1db2281ae20dd64ee0e243'
cpus: 1
mem_limit: '1g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- JAEGER_AGENT_HOST=jaeger
networks:
- sourcegraph
restart: always
# Description: Handles conversion of uploaded precise code intelligence bundles.
#
# Ports exposed to other Sourcegraph services: 3188/TCP
# Ports exposed to the public internet: none
#
precise-code-intel-worker:
container_name: precise-code-intel-worker
image: 'index.docker.io/sourcegraph/precise-code-intel-worker:insiders@sha256:a83643eb396d707e62ebbc5c3457747440576edaed013b5c2bf663a03eb56315'
cpus: 2
mem_limit: '4g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- JAEGER_AGENT_HOST=jaeger
healthcheck:
test: "wget -q 'http://127.0.0.1:3188/healthz' -O /dev/null || exit 1"
interval: 5s
timeout: 5s
retries: 3
start_period: 60s
networks:
- sourcegraph
restart: always
# Description: Handles repository metadata (not Git data) lookups and updates from external code hosts and other similar services.
#
# Disk: 128GB / non-persistent SSD
# Ports exposed to other Sourcegraph services: 3182/TCP 6060/TCP
# Ports exposed to the public internet: none
#
repo-updater:
container_name: repo-updater
image: 'index.docker.io/sourcegraph/repo-updater:insiders@sha256:db4934978c82d1986710a22e79e7dbdcbf19382f8ae0c3d98e84908fde83f3dd'
cpus: 4
mem_limit: '4g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- JAEGER_AGENT_HOST=jaeger
- 'GITHUB_BASE_URL=http://github-proxy:3180'
volumes:
- 'repo-updater:/mnt/cache'
networks:
- sourcegraph
restart: always
# Description: Manages background processes.
#
# Disk: 128GB / non-persistent SSD
# Ports exposed to other Sourcegraph services: 3189/TCP 6060/TCP
# Ports exposed to the public internet: none
#
worker:
container_name: worker
image: 'index.docker.io/sourcegraph/worker:insiders@sha256:60bb1263a5a4b18ee1de32aa5e9151102ab0680e84b263cca687e01fd1eefc45'
cpus: 4
mem_limit: '4g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- JAEGER_AGENT_HOST=jaeger
- 'SRC_GIT_SERVERS=gitserver-0:3178'
- 'SEARCHER_URL=http://searcher-0:3181'
- 'SYMBOLS_URL=http://symbols-0:3184'
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
- 'GITHUB_BASE_URL=http://github-proxy:3180'
volumes:
- 'worker:/mnt/cache'
networks:
- sourcegraph
restart: always
# Description: Backend for syntax highlighting operations.
#
# Disk: none
# Ports exposed to other Sourcegraph services: 9238/TCP 6060/TCP
# Ports exposed to the public internet: none
#
syntect-server:
container_name: syntect-server
image: 'index.docker.io/sourcegraph/syntax-highlighter:insiders@sha256:c7154c611a62a900c79b49bf1ca99af75ec2db779b7fb4303f0abf20022ba60c'
cpus: 4
mem_limit: '6g'
healthcheck:
test: "wget -q 'http://127.0.0.1:9238/health' -O /dev/null || exit 1"
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
networks:
- sourcegraph
restart: always
# Description: Backend for symbols operations.
#
# Disk: 128GB / non-persistent SSD
# Ports exposed to other Sourcegraph services: 3184/TCP 6060/TCP
# Ports exposed to the public internet: none
#
symbols-0:
container_name: symbols-0
image: 'index.docker.io/sourcegraph/symbols:insiders@sha256:28ee85a4ad008ba1d54125d70c75a59269fee048966a32c235a7c8ab5a88bd3b'
cpus: 2
mem_limit: '4g'
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- JAEGER_AGENT_HOST=jaeger
healthcheck:
test: "wget -q 'http://127.0.0.1:3184/healthz' -O /dev/null || exit 1"
interval: 5s
timeout: 5s
retries: 3
start_period: 60s
volumes:
- 'symbols-0:/mnt/cache'
networks:
- sourcegraph
restart: always
# Description: Prometheus collects metrics and aggregates them into graphs.
#
# Disk: 200GB / persistent SSD
# Ports exposed to other Sourcegraph services: none
# Ports exposed to the public internet: none (HTTP 9090 should be exposed to admins only)
#
prometheus:
container_name: prometheus
image: 'index.docker.io/sourcegraph/prometheus:insiders@sha256:b36ad28d24e010cfacb6c21d8b95656f78e2f1cd74ab43fdddfa35b181d9fe39'
cpus: 4
mem_limit: '8g'
volumes:
- 'prometheus-v2:/prometheus'
- '../prometheus:/sg_prometheus_add_ons'
ports:
- '0.0.0.0:9090:9090'
networks:
- sourcegraph
restart: always
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
# Description: Dashboards and graphs for Prometheus metrics.
#
# Disk: 2GB / persistent SSD
# Ports exposed to other Sourcegraph services: none
# Ports exposed to the public internet: none (HTTP 3370 should be exposed to admins only)
#
# Add the following environment variables if you wish to use an auth proxy with Grafana:
#
# 'GF_AUTH_PROXY_ENABLED=true'
# 'GF_AUTH_PROXY_HEADER_NAME='X-Forwarded-User'
# 'GF_SERVER_ROOT_URL='https://grafana.example.com'
grafana:
container_name: grafana
image: 'index.docker.io/sourcegraph/grafana:insiders@sha256:00064d24e19e1159dd70d12bc328db64e8c45fb53062b9b0e3db93984371836d'
cpus: 1
mem_limit: '1g'
volumes:
- 'grafana:/var/lib/grafana'
- '../grafana/datasources:/sg_config_grafana/provisioning/datasources'
- '../grafana/dashboards:/sg_grafana_additional_dashboards'
ports:
- '0.0.0.0:3370:3370'
networks:
- sourcegraph
restart: always
# Description: Publishes Prometheus metrics about Docker containers.
#
# Disk: none
# Ports exposed to other Sourcegraph services: 8080/TCP
# Ports exposed to the public internet: none
#
cadvisor:
container_name: cadvisor
image: 'index.docker.io/sourcegraph/cadvisor:insiders@sha256:87571e704d066e9edaa6034cf73dd32042e24a14505c281db0505622940baab3'
cpus: 1
mem_limit: '1g'
# You may set `privileged` to `false and `cadvisor` will run with reduced privileges.
# `cadvisor` requires root privileges in order to display provisioning metrics.
# These metrics provide critical information to help you scale the Sourcegraph deployment.
# If you would like to bring your own infrastructure monitoring & alerting solution,
# you may want to remove the `cadvisor` container completely
privileged: true
volumes:
- '/:/rootfs:ro'
- '/var/run:/var/run:ro'
- '/sys:/sys:ro'
- '/var/lib/docker/:/var/lib/docker:ro'
- '/dev/disk/:/dev/disk:ro'
# Uncomment to enable container monitoring on MacOS
# - '/var/run/docker.sock:/var/run/docker.sock:ro'
devices:
- '/dev/kmsg'
networks:
- sourcegraph
restart: always
command:
- --port=8080
# Description: Jaeger all-in-one instance
# (https://www.jaegertracing.io/docs/1.17/getting-started/#all-in-one) for distributed tracing.
#
# Disk: none
# Ports exposed to other Sourcegraph services: 5778/TCP 6831/UDP 6832/UDP 14250/TCP
# Ports exposed to the public internet: none
# Ports exposed to site admins only: 16686/HTTP
#
jaeger:
container_name: jaeger
image: 'index.docker.io/sourcegraph/jaeger-all-in-one:insiders@sha256:5ddf4be454010327b9aa79c33cd447e5fb1ec64e7ad4add9702731dfdd497c6d'
cpus: 0.5
mem_limit: '512m'
ports:
# Query port
- '0.0.0.0:16686:16686'
# Collector port
- '0.0.0.0:14250:14250'
# Agent ports
- '0.0.0.0:5778:5778'
- '0.0.0.0:6831:6831'
- '0.0.0.0:6832:6832'
networks:
- sourcegraph
restart: always
command: ['--memory.max-traces=20000']
environment:
- 'SAMPLING_STRATEGIES_FILE=/etc/jaeger/sampling_strategies.json'
# Description: PostgreSQL database for various data.
#
# Disk: 128GB / persistent SSD
# Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
# Ports exposed to the public internet: none
#
pgsql:
container_name: pgsql
image: 'index.docker.io/sourcegraph/postgres-12-alpine:135107_2022-03-03_9498a8bd3366@sha256:e26b159dc7c0c47d136886390c899816e669a3c2c1ead689bdad0b610364e45e'
cpus: 4
mem_limit: '4g'
shm_size: '1g'
healthcheck:
test: '/liveness.sh'
interval: 10s
timeout: 1s
retries: 10
start_period: 1h
volumes:
- 'pgsql:/data/'
- '../pgsql/conf:/conf/'
networks:
- sourcegraph
restart: always
stop_grace_period: 120s
# Description: This container will collect and expose prometheus metrics about `pgsql` PostgreSQL server.
#
# Disk: None
# Ports exposed to other Sourcegraph services: 9187/TCP
# Ports exposed to the public internet: none
#
# If you're using a DB instance hosted outside of docker-compose, the environment variables
# for this container will need to be updated to reflect the new connection information.
pgsql-exporter:
container_name: pgsql-exporter
image: 'index.docker.io/sourcegraph/postgres_exporter:insiders@sha256:9c7eb0c76afcd2d564e9fd9a71d2a4443285aca409521e778ceddf455e2c4d6a'
cpus: 0.1
mem_limit: '50m'
networks:
- sourcegraph
restart: always
environment:
- 'DATA_SOURCE_NAME=postgres://sg:@pgsql:5432/?sslmode=disable'
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/queries.yaml'
# Description: PostgreSQL database for code intelligence data.
#
# Disk: 128GB / persistent SSD
# Network: 1Gbps
# Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
# Ports exposed to the public internet: none
#
codeintel-db:
container_name: codeintel-db
image: 'index.docker.io/sourcegraph/codeintel-db:insiders@sha256:f24ab8dd55fa7c1017cbf235f93e51d4d38be0231f9488f3fd11883184b0969e'
cpus: 4
mem_limit: '4g'
shm_size: '1g'
healthcheck:
test: '/liveness.sh'
interval: 10s
timeout: 1s
retries: 10
start_period: 1h
volumes:
- 'codeintel-db:/data/'
- '../codeintel-db/conf:/conf/'
networks:
- sourcegraph
restart: always
stop_grace_period: 120s
# Description: This container will collect and expose prometheus metrics about `codeintel-db` PostgreSQL server.
#
# Disk: None
# Ports exposed to other Sourcegraph services: 9187/TCP
# Ports exposed to the public internet: none
#
# If you're using a DB instance hosted outside of docker-compose, the environment variables
# for this container will need to be updated to reflect the new connection information.
codeintel-db-exporter:
container_name: codeintel-db-exporter
image: 'index.docker.io/sourcegraph/postgres_exporter:insiders@sha256:9c7eb0c76afcd2d564e9fd9a71d2a4443285aca409521e778ceddf455e2c4d6a'
cpus: 0.1
mem_limit: '50m'
networks:
- sourcegraph
restart: always
environment:
- 'DATA_SOURCE_NAME=postgres://sg:@codeintel-db:5432/?sslmode=disable'
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/code_intel_queries.yaml'
# Description: PostgreSQL database for code insights data.
#
# Disk: 128GB / persistent SSD
# Network: 1Gbps
# Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
# Ports exposed to the public internet: none
#
codeinsights-db:
container_name: codeinsights-db
image: 'index.docker.io/sourcegraph/codeinsights-db:insiders@sha256:7c016ad0893bf00b95ebf98f59b772358b0f638f5ec3361e95148a42d641559b'
cpus: 4
mem_limit: '2g'
shm_size: '1g'
environment:
- POSTGRES_PASSWORD=password
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
- PGDATA=/var/lib/postgresql/data/pgdata
healthcheck:
test: '/liveness.sh'
interval: 10s
timeout: 1s
retries: 10
start_period: 1h
volumes:
- 'codeinsights-db:/var/lib/postgresql/data/'
- '../codeinsights-db/conf:/conf/'
networks:
- sourcegraph
restart: always
stop_grace_period: 120s
# Description: This container will collect and expose prometheus metrics about `codeinsights-db` PostgreSQL server.
#
# Disk: None
# Ports exposed to other Sourcegraph services: 9187/TCP
# Ports exposed to the public internet: none
#
# If you're using a DB instance hosted outside of docker-compose, the environment variables
# for this container will need to be updated to reflect the new connection information.
codeinsights-db-exporter:
container_name: codeinsights-db-exporter
image: 'index.docker.io/sourcegraph/postgres_exporter:insiders@sha256:9c7eb0c76afcd2d564e9fd9a71d2a4443285aca409521e778ceddf455e2c4d6a'
cpus: 0.1
mem_limit: '50m'
networks:
- sourcegraph
restart: always
environment:
- 'DATA_SOURCE_NAME=postgres://postgres:password@codeinsights-db:5432/?sslmode=disable'
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/code_insights_queries.yaml'
# Description: MinIO for storing LSIF uploads.
#
# Disk: 128GB / persistent SSD
# Network: 1Gbps
# Ports exposed to other Sourcegraph services: 9000/TCP
# Ports exposed to public internet: none
#
minio:
container_name: minio
image: 'index.docker.io/sourcegraph/minio:insiders@sha256:0daf4c0c821634eeefbf90f48d467eece09597aff5d9f582685c8c875f03e6fa'
cpus: 1
mem_limit: '1g'
environment:
- 'MINIO_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE'
- 'MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://127.0.0.1:9000/minio/health/live']
interval: 10s
timeout: 1s
retries: 3
start_period: 15s
volumes:
- 'minio:/data'
networks:
- sourcegraph
restart: always
command: ['server', '/data']
# Description: Redis for storing short-lived caches.
#
# Disk: 128GB / persistent SSD
# Ports exposed to other Sourcegraph services: 6379/TCP 9121/TCP
# Ports exposed to the public internet: none
#
redis-cache:
container_name: redis-cache
image: 'index.docker.io/sourcegraph/redis-cache:insiders@sha256:793b73f1cd185682109dc3adb235d74aab9a3152c2f6afccf0913a0cf9210879'
cpus: 1
mem_limit: '7g'
volumes:
- 'redis-cache:/redis-data'
networks:
- sourcegraph
restart: always
# Description: Redis for storing semi-persistent data like user sessions.
#
# Disk: 128GB / persistent SSD
# Ports exposed to other Sourcegraph services: 6379/TCP 9121/TCP
# Ports exposed to the public internet: none
#
redis-store:
container_name: redis-store
image: 'index.docker.io/sourcegraph/redis-store:insiders@sha256:130abf3b12d6b4be117aaf0f4ab49e1e00d9d80b8c9b94b0b4594e84fd46d010'
cpus: 1
mem_limit: '7g'
volumes:
- 'redis-store:/redis-data'
networks:
- sourcegraph
restart: always
volumes:
caddy:
gitserver-0:
grafana:
pgsql:
codeintel-db:
codeinsights-db:
minio:
prometheus-v2:
redis-cache:
redis-store:
repo-updater:
worker:
searcher-0:
sourcegraph-frontend-0:
sourcegraph-frontend-internal-0:
symbols-0:
zoekt-0-shared:
networks:
sourcegraph: