-
Notifications
You must be signed in to change notification settings - Fork 515
/
deploy-frontend.sh
executable file
·40 lines (35 loc) · 1.34 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
#!/usr/bin/env bash
set -e
# Description: Serves the frontend of Sourcegraph via HTTP(S).
#
# CPU: 2
# Memory: 4GB
# Disk: 1GB / non-persistent SSD (only for read-only config file)
# Network: 100mbps
# Liveness probe: HTTP GET http://sourcegraph-frontend:3080/healthz
# Ports exposed to other Sourcegraph services: none
# Ports exposed to the public internet: 3080 (HTTP) and/or 3443 (HTTPS)
#
docker create \
--name=sourcegraph-frontend \
--network=sourcegraph \
--restart=always \
-e PGHOST=pgsql \
-e SRC_GIT_SERVERS=gitserver-0:3178 \
-e SEARCHER_URL=http://searcher-0:3181 \
-e SYMBOLS_URL=http://symbols-0:3184 \
-e SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090 \
-p 127.0.0.1:3080:3080 \
sourcegraph/frontend:3.0.0-alpha.4
# For HTTPS instead of HTTP (3080), add the following to 'docker create' above:
# -p 127.0.0.1:3443:3443 \
# -e TLS_CERT=$MY_SECRET_TLS_CERT \
# -e TLS_KEY=$MY_SECRET_TLS_KEY \
# Note: SRC_GIT_SERVERS, SEARCHER_URL, and SYMBOLS_URL are space-seperated
# 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.
# Create /etc/sourcegraph/config.json
docker cp ./sourcegraph sourcegraph-frontend:/etc/
docker start sourcegraph-frontend
echo "Deployed sourcegraph-frontend service"