sergi0g / cup

The easiest way to check for your container updates
https://sergi0g.github.io/cup/docs
GNU Affero General Public License v3.0
116 stars 2 forks source link

[FR] Official docker compose file #26

Closed ioverho closed 1 week ago

ioverho commented 1 week ago

Firstly, thanks for making cup. This with newreleases.io has proven to be a much simpler and more enjoyable replacement for watchtower/what's up docker/diun.

I'd suggest support for running the cup docker container permanently, for example via docker compose. At idle the image is only using 15-25MB of memory, and has very low CPU usage. Personally, it's worth it, as it means I don't have to ssh into my server every time I want to check for updates.

It also simplifies installation, updating and usage, e.g.:

  1. docker compose up -d vs docker run -tv /var/run/docker.sock:/var/run/docker.sock -p 9000:9000 ghcr.io/sergi0g/cup serve -p 9000
  2. docker compose run cup check vs docker run -tv /var/run/docker.sock:/var/run/docker.sock ghcr.io/sergi0g/cup check node:latest

I've been using the following compose.yaml file, and it seems to works as expected:

services:
  cup:
    image: ghcr.io/sergi0g/cup
    container_name: cup
    restart: unless-stopped
    command: -c /config/cup.json serve
    ports:
      - {$PORT}:8000
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - {$CONFIG_LOCATION}/cup.json:/config/cup.json

But I'm not sure the configuration file is actually ingested. Specifically, adding theme: "blue" to the .json seems to have no effect. Using a malformed config file raises errors though: Failed to parse config!. Adding irrelevant options seems to have no effect. I haven't checked the other configuration options.

Potentially adding a default configuration file might also help simplify the -c /config/cup.json command. You would only need to add a volume map to overwrite the default.

Concretely, would it be possible to get a supported compose.yaml file? Thanks again!

sergi0g commented 1 week ago

Hello @ioverho!

Docker Compose has already been mentioned in #15.

I'm currently not providing an official docker compose file because I think it's better if users create their own, according to their needs. It is however something that I will consider. Maybe I can add an example to the docs.

I'd suggest support for running the cup docker container permanently, for example via docker compose. At idle the image is only using 15-25MB of memory, and has very low CPU usage. Personally, it's worth it, as it means I don't have to ssh into my server every time I want to check for updates.

As far as I know, this is how most people are running Cup at the moment and that's what it's intended for! :joy:

Specifically, adding theme: "blue" to the .json seems to have no effect.

Do you have any screenshots? It works fine for me.

My testing cup.json is this:

{
    "theme": "blue"
}

If the problem still occurs, please open another issue just for that problem!

ioverho commented 1 week ago

My bad on both fronts.

I would suggest including the example compose file on the documentation site. It's a bit difficult to find otherwise.

As for the theme, I was looking in light mode, and the difference is barely noticeable (page background and container background switches?). In dark mode, it's definitely working.

Sorry!

sergi0g commented 1 week ago

It's ok, don't worry! Everybody makes mistakes!

I would suggest including the example compose file on the documentation site. It's a bit difficult to find otherwise.

I'll consider it.

As for the theme, I was looking in light mode, and the difference is barely noticeable (page background and container background switches?). In dark mode, it's definitely working.

In light mode the difference is nearly unnoticeable. It makes a huge difference for dark mode users, though, so that's why Cup has 2 themes. (I use the blue theme, of course)