forked from leboncoin/zoekt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.webserver
24 lines (18 loc) · 969 Bytes
/
Dockerfile.webserver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM alpine:3.15.0
RUN apk update --no-cache && apk upgrade --no-cache && \
apk add --no-cache ca-certificates bind-tools tini && \
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 DATA_DIR /data/index
RUN mkdir -p ${DATA_DIR}
# We copy from the locally built zoekt image
COPY --from=zoekt /usr/local/bin/zoekt-webserver /usr/local/bin/
# zoekt-webserver has a large stable heap size (10s of gigs), and as such the
# default GOGC=100 could be better tuned. https://dave.cheney.net/tag/gogc
ENV GOGC=50
ENTRYPOINT ["/sbin/tini", "--"]
CMD zoekt-webserver -index $DATA_DIR -pprof -rpc