mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
Add zoekt webserver dockerfile
This commit is contained in:
parent
edb6e1a28f
commit
f40f18fd66
3 changed files with 48 additions and 0 deletions
30
Dockerfile.zoekt-webserver
Normal file
30
Dockerfile.zoekt-webserver
Normal 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"]
|
||||||
|
|
@ -6,5 +6,19 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- GITHUB_TOKEN=${GITHUB_TOKEN}
|
- GITHUB_TOKEN=${GITHUB_TOKEN}
|
||||||
- CONFIG_PATH=/app/configs/config.json
|
- CONFIG_PATH=/app/configs/config.json
|
||||||
|
- DATA_DIR=/zoekt-data/
|
||||||
volumes:
|
volumes:
|
||||||
- ./configs/config.json:/app/configs/config.json:r
|
- ./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:
|
||||||
4
entrypoint.zoekt-webserver.sh
Normal file
4
entrypoint.zoekt-webserver.sh
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
exec "zoekt-webserver" "-index" "${DATA_DIR}/index"
|
||||||
Loading…
Reference in a new issue