Owncloud Docker can`t access redis in a different host

Steps to reproduce

  1. deploy the following docker compose descriptor

version: ‘2.1’

volumes:
files:
driver: local
mysql:
driver: local
backup:
driver: local
redis:
driver: local

services:
owncloud:
image: owncloud/server:10.6
restart: always
ports:
- 8080:8080
depends_on:
- db
environment:
- OWNCLOUD_DOMAIN=localhost:8080
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_USERNAME=owncloud
- OWNCLOUD_DB_PASSWORD=owncloud
- OWNCLOUD_DB_HOST=db
- OWNCLOUD_ADMIN_USERNAME=admin
- OWNCLOUD_ADMIN_PASSWORD=1234567
- OWNCLOUD_MYSQL_UTF8MB4=true
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=192.168.15.50
- OWNCLOUD_REDIS_HOST=30637
healthcheck:
test: [“CMD”, “/usr/bin/healthcheck”]
interval: 30s
timeout: 10s
retries: 5
volumes:
- files:/mnt/data

db:
image: webhippie/mariadb:latest
restart: always
environment:
- MARIADB_ROOT_PASSWORD=owncloud
- MARIADB_USERNAME=owncloud
- MARIADB_PASSWORD=owncloud
- MARIADB_DATABASE=owncloud
- MARIADB_MAX_ALLOWED_PACKET=128M
- MARIADB_INNODB_LOG_FILE_SIZE=64M
healthcheck:
test: [“CMD”, “/usr/bin/healthcheck”]
interval: 30s
timeout: 10s
retries: 5
volumes:
- mysql:/var/lib/mysql
- backup:/var/lib/backup

  1. Waits for it to try connect to redis

Expected behaviour

It should connect to redis and in the log file should be visible the following lines:

owncloud_1 | Waiting for Redis…
owncloud_1 | services are ready!

Actual behaviour

It keep trying to connect to redis but hangs up. In the log file the following is visible:

owncloud_1 | Waiting for Redis…
owncloud_1 | services aren’t ready in 1m0s

Server configuration

Operating system: Ubuntu / Docker

Web server: defined in docker image owncloud/server:10.6

Database: defined in docker image owncloud/server:10.6

PHP version: defined in docker image owncloud/server:10.6

ownCloud version: defined in docker image owncloud/server:10.6

There seems to be redis missing from your docker-compose stack. I would recommend to define it.

EDIT: I don’t think the official docker images are able to run without docker, you’d have to build your own images if you wanted to do that. However, please be aware, that’s not officially supported, and that for a good reason…

1 Like

I’m not deploying redis in this descriptor. I already have a redis instance listening in the following IP 192.168.15.50:30637

Is that IP accessible from the docker network?

- OWNCLOUD_REDIS_HOST=192.168.15.50
- OWNCLOUD_REDIS_HOST=30637

It seems you want to set the port in the second env variable.

3 Likes

Yes. I can access the redis server via cli from the same server where owncloud is hosted
In fact I’m sniffing the network and owncloud is not even calling this IP

You are right. I used the following env and it started working:

  • OWNCLOUD_REDIS_PORT=30637

Thank you

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.