-
Notifications
You must be signed in to change notification settings - Fork 525
/
Copy pathdeploy-frontend.sh
executable file
·52 lines (49 loc) · 2.24 KB
/
deploy-frontend.sh
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
#!/usr/bin/env bash
set -e
source ./replicas.sh
# Description: Serves the frontend of Sourcegraph via HTTP(S).
#
# Disk: 128GB / non-persistent SSD
# Network: 100mbps
# Liveness probe: HTTP GET http://sourcegraph-frontend:3080/healthz
# Ports exposed to other Sourcegraph services: 6060/TCP
# Ports exposed to the public internet: 3080 (HTTP) and/or 3443 (HTTPS)
#
VOLUME="$HOME/sourcegraph-docker/sourcegraph-frontend-$1-disk"
./ensure-volume.sh $VOLUME 100
docker run --detach \
--name=sourcegraph-frontend-$1 \
--network=sourcegraph \
--restart=always \
--cpus=4 \
--memory=8g \
--health-cmd="wget -q 'http://127.0.0.1:3080/healthz' -O /dev/null || exit 1" \
--health-interval=5s \
--health-timeout=10s \
--health-retries=5 \
--health-start-period=300s \
-e DEPLOY_TYPE=pure-docker \
-e GOMAXPROCS=12 \
-e 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317' \
-e PGHOST=pgsql \
-e CODEINTEL_PGHOST=codeintel-db \
-e CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@codeinsights-db:5432/postgres \
-e SRC_GIT_SERVERS="$(addresses "gitserver-" $NUM_GITSERVER ":3178")" \
-e SRC_SYNTECT_SERVER=http://syntect-server:9238 \
-e SEARCHER_URL="$(addresses "http://searcher-" $NUM_SEARCHER ":3181")" \
-e SYMBOLS_URL="$(addresses "http://symbols-" $NUM_SYMBOLS ":3184")" \
-e INDEXED_SEARCH_SERVERS="$(addresses "zoekt-webserver-" $NUM_INDEXED_SEARCH ":6070")" \
-e SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090 \
-e REPO_UPDATER_URL=http://repo-updater:3182 \
-e GRAFANA_SERVER_URL=http://grafana:3370 \
-e PROMETHEUS_URL=http://prometheus:9090 \
-e PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore \
-e PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000 \
-v $VOLUME:/mnt/cache \
-p 0.0.0.0:$((3080 + $1)):3080 \
index.docker.io/sourcegraph/frontend:187572_2022-12-06_cbecc5321c7d@sha256:73e64a8636e70ebbaf7f4a3300479529294f67e8cf644cdaea02435915aec869
# 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.
echo "Deployed sourcegraph-frontend $1 service"