[Question] How to pass only redis host as an environment variable?
EonYang opened this issue · 2 comments
EonYang commented
Hi, I'm trying to put rq_dashboard into docker-compose.yaml
.
I see that I can pass RQ_DASHBOARD_REDIS_URL, but since docker-compose can only give me a host, I need to pass only the host.
My case:
# docker-compose.yaml
version: "3"
services:
rq-dashboard:
container_name: RQ_DASHBOARD
image: eoranged/rq-dashboard
environment:
- RQ_DASHBOARD_REDIS_URL=redis # <- this doesn't work because Docker can only provide the hostname.
ports:
- 4001:9181
networks:
- redis-net
depends_on:
- redis
redis:
container_name: REDIS
image: redis:4.0.5-alpine
command: ["redis-server", "--appendonly", "yes"]
hostname: redis
networks:
- redis-net
volumes:
- redis-data:/data
networks:
redis-net:
volumes:
redis-data:
Your help is much appreciated.
EonYang commented
Find a workaround by passing a
command
instead ofenvironment
command: python -m rq_dashboard -H redis
Edit: Sorry, that didn't solve it. Reopening and still waiting for help.
EonYang commented
Just realize I can pass - RQ_DASHBOARD_REDIS_URL=redis://<redis:6379>
directly.
- RQ_DASHBOARD_REDIS_URL=redis://<redis:6379>