Commit
Message
Changed Files (5)
-
added .dockerignore
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4668da0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +target +.git +.fastembed_cache +public +*.tar.gz +docs +media +.github -
added Containerfile
diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..66ad873 --- /dev/null +++ b/Containerfile @@ -0,0 +1,17 @@ +FROM rust:trixie AS builder +RUN apt-get update && apt-get install -y --no-install-recommends \ + pkg-config libssl-dev && \ + rm -rf /var/lib/apt/lists/* +WORKDIR /app +COPY . . +RUN cargo build --release + +FROM debian:trixie-slim +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates adduser && \ + rm -rf /var/lib/apt/lists/* && \ + adduser --disabled-password --gecos '' search_hub +COPY --from=builder /app/target/release/search_hub /usr/local/bin/ +USER search_hub +EXPOSE 8080 +ENTRYPOINT ["search_hub"] -
modified contrib/release.sh
diff --git a/contrib/release.sh b/contrib/release.sh index b73a5e0..80c4307 100755 --- a/contrib/release.sh +++ b/contrib/release.sh @@ -94,6 +94,18 @@ else echo "warning: abbaye not found, skipping site build" fi +echo "==> Building container image" +if command -v buildah &>/dev/null; then + buildah build -t "oci.vit.am/search-hub:v$VERSION" -t "oci.vit.am/search-hub:latest" -f Containerfile . 2>&1 + read -r -p "Push container image to oci.vit.am? [y/N] " REPLY + if [[ "$REPLY" =~ ^[Yy]$ ]]; then + buildah push "oci.vit.am/search-hub:v$VERSION" 2>&1 + buildah push "oci.vit.am/search-hub:latest" 2>&1 + fi +else + echo "warning: buildah not found, skipping container image build" +fi + echo "==> Uploading to server" read -r -p "Upload public/ to ololduck@vit.am:public_html/search_hub/? [y/N] " REPLY if [[ "$REPLY" =~ ^[Yy]$ ]]; then @@ -101,6 +113,7 @@ if [[ "$REPLY" =~ ^[Yy]$ ]]; then fi echo "" echo "Release v$VERSION ready." -echo "To publish: git push --tags origin main" -echo "To upload: rsync -avz --progress public/ ololduck@vit.am:public_html/search_hub/" -echo "To undo: git tag -d v$VERSION && git reset --soft HEAD~1" +echo "To publish: git push --tags origin main" +echo "To upload: rsync -avz --progress public/ ololduck@vit.am:public_html/search_hub/" +echo "To push image: buildah push oci.vit.am/search-hub:v$VERSION && buildah push oci.vit.am/search-hub:latest" +echo "To undo: git tag -d v$VERSION && git reset --soft HEAD~1" -
added contrib/search-hub.container
diff --git a/contrib/search-hub.container b/contrib/search-hub.container new file mode 100644 index 0000000..417ef96 --- /dev/null +++ b/contrib/search-hub.container @@ -0,0 +1,23 @@ +# Podman Quadlet -- copy to ~/.config/containers/systemd/search-hub.container +# Then: +# systemctl --user daemon-reload +# systemctl --user enable --now search-hub +# +# Logs: journalctl --user -u search-hub -f + +[Unit] +Description=SearchHub web server + +[Container] +Image=oci.vit.am/search-hub:latest +PublishPort=8080:8080 +Volume=%h/.config/search_hub:/home/search_hub/.config/search_hub:ro +Volume=%h/.local/share/search_hub:/home/search_hub/.local/share/search_hub +Exec=serve + +[Service] +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=default.target -
added docker-compose.yaml
diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..bf92810 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,21 @@ +services: + search-hub: + image: oci.vit.am/search-hub:latest + container_name: search-hub + ports: + - "8080:8080" + volumes: + - ~/.config/search_hub:/home/search_hub/.config/search_hub:ro + - ~/.local/share/search_hub:/home/search_hub/.local/share/search_hub + restart: unless-stopped + + # Optional: self-hosted SearXNG instance for engine aggregation + # searxng: + # image: searxng/searxng:latest + # container_name: searxng + # ports: + # - "8888:8080" + # volumes: + # - ./searxng/settings.yml:/etc/searxng/settings.yml:ro + # - ./searxng/limiter.toml:/etc/searxng/limiter.toml:ro + # restart: unless-stopped