Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker based setup for self hosting #173

Closed
accforgithubtest opened this issue Dec 27, 2023 · 6 comments
Closed

Docker based setup for self hosting #173

accforgithubtest opened this issue Dec 27, 2023 · 6 comments

Comments

@accforgithubtest
Copy link

Hello there

A docker compose based set up might be the most ideal option for selfhosting. Would be great if there is a

  1. Image on dockherhub / etc, prebuilt for all platforms.
  2. Detailed instructions with a sample example file.
  3. Provide a single config / file that can be volume mounted for configuring the list of RSS feeds.
  4. Environment variables for configuring refresh frequency, etc.

Thank you for this project!

@grabpot
Copy link

grabpot commented Dec 30, 2023

If it helps, here's my recent experience on this topic:

  • There is already an unofficial (?) image on dockerhub: https://hub.docker.com/r/arsfeld/yarr
  • The default etc/dockerfile runs make build_linux which assumes it's compiling for amd64. If you're using an arm64 device, e.g. a Raspberry Pi, then you'll need to run make build_default instead.
  • There's currently an issue with compiling go-sqlite3 on the latest Go 1.21.5 Alpine docker image (used by the above Dockerfile). Adding -D_LARGEFILE64_SOURCE to the CGO_CFLAGS environment variable is a temporary fix. For further information, see: Fix musl build (#1164) mattn/go-sqlite3#1177
  • You can already import/export an OPML file with the list of RSS feeds from the web interface, if that helps.

@nkanaev I'm happy to raise a PR to add this to the docs if you like.

I ended up with the following Dockerfile:

FROM golang:1.21.5-alpine AS build
RUN apk add --no-cache build-base git

WORKDIR /src
RUN git clone https://github.com/nkanaev/yarr.git .
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
RUN make build_default

FROM alpine:3.19
COPY --from=build /src/_output/yarr /usr/local/bin/yarr
RUN mkdir /data
CMD ["/usr/local/bin/yarr", "-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"]

I'm running yarr behind Caddy with Tailscale HTTPS, so my docker-compose.yml file is a bit more complicated, but a basic example might look like this, assuming it's in the same directory as the Dockerfile and that you've also created a sub-directory called data:

version: "3"

services:
  yarr:
    build:
      context: .
    ports:
      - 7070:7070
    volumes:
      - ./data:/data

@rebron1900
Copy link

rebron1900 commented Dec 31, 2023

If it helps, here's my recent experience on this topic:

  • There is already an unofficial (?) image on dockerhub: https://hub.docker.com/r/arsfeld/yarr
  • The default etc/dockerfile runs make build_linux which assumes it's compiling for amd64. If you're using an arm64 device, e.g. a Raspberry Pi, then you'll need to run make build_default instead.
  • There's currently an issue with compiling go-sqlite3 on the latest Go 1.21.5 Alpine docker image (used by the above Dockerfile). Adding -D_LARGEFILE64_SOURCE to the CGO_CFLAGS environment variable is a temporary fix. For further information, see: Fix musl build (#1164) mattn/go-sqlite3#1177
  • You can already import/export an OPML file with the list of RSS feeds from the web interface, if that helps.

@nkanaev I'm happy to raise a PR to add this to the docs if you like.

I ended up with the following Dockerfile:

FROM golang:1.21.5-alpine AS build
RUN apk add --no-cache build-base git

WORKDIR /src
RUN git clone https://github.com/nkanaev/yarr.git .
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
RUN make build_default

FROM alpine:3.19
COPY --from=build /src/_output/yarr /usr/local/bin/yarr
RUN mkdir /data
CMD ["/usr/local/bin/yarr", "-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"]

I'm running yarr behind Caddy with Tailscale HTTPS, so my docker-compose.yml file is a bit more complicated, but a basic example might look like this, assuming it's in the same directory as the Dockerfile and that you've also created a sub-directory called data:

version: "3"

services:
  yarr:
    build:
      context: .
    ports:
      - 7070:7070
    volumes:
      - ./data:/data

Hello, I forked a repository called rebron1900/yarr and made some small improvements.

I want to publish it to Docker Hub using Action, but I encountered an error while running it. After my investigation, I found that the master branch and tag branch of the original author have different file structures. How did they manage to do that?

How can I make it run properly?

@rebron1900
Copy link

@grabpot thks,I have successfully packaged my own Docker image.

@darkdragon-001
Copy link
Contributor

darkdragon-001 commented Dec 31, 2023

Would be great if we could add a GitHub Actions workflow to this repository in order to publish an official image automatically on releases.

Here are the docs.

@darkdragon-001
Copy link
Contributor

@rebron1900 I just saw your workflow at https://github.com/rebron1900/yarr/blob/master/.github/workflows/build-docker-image. Maybe do you want to create a PR to this repository?

@rebron1900
Copy link

@rebron1900 I just saw your workflow at https://github.com/rebron1900/yarr/blob/master/.github/workflows/build-docker-image. Maybe do you want to create a PR to this repository?

Yes, this workflow works really well. And I've also added support for one -click subscription to yarr through Rsshub radar.
Of course, I'm willing to do that. I will try to submit a pull request for the master branch later.

Repository owner locked and limited conversation to collaborators Apr 9, 2024
@nkanaev nkanaev converted this issue into discussion #189 Apr 9, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants