Add zoekt webserver dockerfile

This commit is contained in:
bkellam 2024-08-30 19:03:13 -07:00
parent edb6e1a28f
commit f40f18fd66
3 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,30 @@
FROM golang:1.22.2-alpine3.19 AS builder
RUN apk add --no-cache ca-certificates
WORKDIR /zoekt
COPY vendor/zoekt/go.mod vendor/zoekt/go.sum ./
RUN go mod download
COPY vendor/zoekt ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /cmd/ ./cmd/...
FROM alpine:3.19 AS zoekt
WORKDIR /app
RUN apk add --no-cache git ca-certificates bind-tools tini jansson wget
ENV DATA_DIR /zoekt-data/
RUN mkdir -p ${DATA_DIR}
COPY entrypoint.zoekt-webserver.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
COPY --from=builder \
/cmd/zoekt-webserver \
/usr/local/bin/
EXPOSE 6070
ENTRYPOINT ["/sbin/tini", "--", "./entrypoint.sh"]

View file

@ -6,5 +6,19 @@ services:
environment:
- GITHUB_TOKEN=${GITHUB_TOKEN}
- CONFIG_PATH=/app/configs/config.json
- DATA_DIR=/zoekt-data/
volumes:
- ./configs/config.json:/app/configs/config.json:r
- zoekt_index_cache:/zoekt-data/
zoekt-webserver:
build:
dockerfile: Dockerfile.zoekt-webserver
environment:
- DATA_DIR=/zoekt-data/
ports:
- 6070:6070
volumes:
- zoekt_index_cache:/zoekt-data/
volumes:
zoekt_index_cache:

View file

@ -0,0 +1,4 @@
#!/bin/sh
set -e
exec "zoekt-webserver" "-index" "${DATA_DIR}/index"