Skip to content

make redis server connection configurable through $REDIS_URL#277

Merged
semohr merged 4 commits intopSpitzner:release/2.0.0from
lina-bh:redis-url
Mar 11, 2026
Merged

make redis server connection configurable through $REDIS_URL#277
semohr merged 4 commits intopSpitzner:release/2.0.0from
lina-bh:redis-url

Conversation

@lina-bh
Copy link

@lina-bh lina-bh commented Feb 3, 2026

So that a Redis instance outside of the container may be used, read the REDIS_URL environment variable. If it is set and non-empty, assume it is a redis:// protocol URL and connect to that instead of forking a Redis instance inside the container. This allows the well understood behaviour of a dedicated Redis image, or a Redis running outside a container, to be used, including more flexible logging and control over configuration.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.

@lina-bh
Copy link
Author

lina-bh commented Feb 3, 2026

I see that you have a new release coming up, so I'll wait for your lead on what to put in the changelog and where

@pSpitzner
Copy link
Owner

Hi @lina-bh,

thanks for the PR.

I think this is a good addition. I would make this part of 2.0.

Please base the PR on the release/2.0.0 branch, and just include a note about the new setting in the changelog (we will reformat it before the release, so anywhere within the 'added' section is fine)

Also, we should document it in docs/configuration.md, ideally with a small sample compose file to showcase the benefits.
Tbh I do not know how the external server will affect our init scripts that use rq worker commands, or the logging we apply to them, so the compose file will help me check it out.

best,
p

@lina-bh lina-bh changed the base branch from main to release/2.0.0 February 3, 2026 17:27
@lina-bh
Copy link
Author

lina-bh commented Feb 25, 2026

Apologies for the delay. It's been a long time since I used docker-compose, I've been using Podman/Quadlets and Kubernetes for a while now, and I haven't keep dockerd and docker-compose around. Please let me know how you get on with the example in configuration.md. The DNS names for the containers should be resolvable within each other since docker-compose creates a network for each stack.

Copy link
Collaborator

@semohr semohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested the changes in a local dev setup which uses an external redis container:

services:
  redis:
    image: docker.io/library/redis:alpine
    volumes:
      - redis:/data
  beets-flask:
    container_name: beets-flask
    hostname: beets-container
    build:
      context: ..
      dockerfile: docker/Dockerfile
      target: dev
    image: beets-flask
    restart: unless-stopped
    ports:
      - "5001:5001" # for beets-flask
      - "5173:5173" # for vite dev server
    environment:
      # 502 is default on macos, 1000 on linux
      USER_ID: 1000
      GROUP_ID: 1000
      LOG_LEVEL_BEETSFLASK: DEBUG
      LOG_LEVEL_OTHERS: WARNING 
      REDIS_URL: redis://redis:6379/
    volumes:
      - ../local/music/:/music/
      - ../local/config/:/config
      - ../local/logs/:/logs
      - ../:/repo/

volumes:
  redis:

Everything seems to work as expected.

Thanks for the addition!

@lina-bh
Copy link
Author

lina-bh commented Mar 11, 2026

Thanks for fixing that bit in the docs, I had noticed that but forgot to change it.

@semohr semohr merged commit f18e565 into pSpitzner:release/2.0.0 Mar 11, 2026
2 checks passed
@semohr
Copy link
Collaborator

semohr commented Mar 11, 2026

No worries. Sorry for us being slow with responses and general fixes recently. Normally a simple addition like this sholdnt take a month to get merged 😨

Once we merge the other recent PRs, we gonna create a new release candidate and you can test it in your setup. Hopefully latest this weekend 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants