diff --git a/.gitignore b/.gitignore index 5b6c096..88ac191 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,11 @@ +node_modules/ +.agent/ +*.exe +*.exe~ +*.dll +*.so +*.dylib +*.test +*.out +gosearch config.toml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c1bb6db --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# Build stage +FROM golang:1.24-alpine AS builder + +RUN apk add --no-cache git + +WORKDIR /src + +# Cache module downloads +COPY go.mod go.sum ./ +RUN go mod download + +# Copy source and build +COPY . . +RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /gosearch ./cmd/searxng-go + +# Runtime stage +FROM alpine:3.21 + +RUN apk add --no-cache ca-certificates tzdata + +COPY --from=builder /gosearch /usr/local/bin/gosearch +COPY config.example.toml /etc/gosearch/config.example.toml + +EXPOSE 8080 + +ENTRYPOINT ["gosearch"] +CMD ["-config", "/etc/gosearch/config.toml"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..409edfd --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +# Docker Compose for gosearch + Valkey +# +# Usage: +# cp config.example.toml config.toml # edit as needed +# docker compose up -d + +services: + gosearch: + build: . + ports: + - "8080:8080" + volumes: + - ./config.toml:/etc/gosearch/config.toml:ro + depends_on: + valkey: + condition: service_healthy + restart: unless-stopped + + valkey: + image: valkey/valkey:8 + ports: + - "6379:6379" + volumes: + - valkey-data:/data + healthcheck: + test: ["CMD", "valkey-cli", "ping"] + interval: 5s + timeout: 3s + retries: 5 + restart: unless-stopped + +volumes: + valkey-data: diff --git a/searxng-go b/searxng-go new file mode 100755 index 0000000..4f75db2 Binary files /dev/null and b/searxng-go differ