forked from leboncoin/zoekt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.indexserver
29 lines (23 loc) · 1.13 KB
/
Dockerfile.indexserver
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
FROM alpine:3.15.0
RUN apk update --no-cache && apk upgrade --no-cache && \
apk add --no-cache ca-certificates bind-tools tini git jansson && \
apk add --upgrade --no-cache libcrypto1.1>=1.1.1n-r0 libssl1.1>=1.1.1n-r0
# Run as non-root user sourcegraph. External volumes should be mounted under /data (which will be owned by sourcegraph).
RUN mkdir -p /home/sourcegraph
RUN addgroup -S sourcegraph && adduser -S -G sourcegraph -h /home/sourcegraph sourcegraph && mkdir -p /data && chown -R sourcegraph:sourcegraph /data
USER sourcegraph
WORKDIR /home/sourcegraph
ENV SRC_FRONTEND_INTERNAL http://sourcegraph-frontend-internal
ENV DATA_DIR /data/index
RUN mkdir -p ${DATA_DIR}
COPY --from=zoekt \
/usr/local/bin/universal-* \
/usr/local/bin/zoekt-sourcegraph-indexserver \
/usr/local/bin/zoekt-archive-index \
/usr/local/bin/zoekt-git-index \
/usr/local/bin/zoekt-merge-index \
/usr/local/bin/
# zoekt indexing has a large stable heap size (gigs), and as such the default
# GOGC=100 could be better tuned. https://dave.cheney.net/tag/gogc
ENV GOGC=50
ENTRYPOINT ["/sbin/tini", "--", "zoekt-sourcegraph-indexserver"]