Hi I have following docker-compose.yaml file.
version: "3.9"
volumes:
local_postgres_data2: {}
local_postgres_data_backups2: {}
services:
postgres:
image: postgres
container_name: angel-postgres
restart: always
volumes:
- local_postgres_data2:/var/lib/postgresql/data:Z
- local_postgres_data_backups2:/backups:z
environment:
POSTGRES_DB: angel-agility
POSTGRES_HOST: localhost
POSTGRES_USER: angel-user
POSTGRES_PASSWORD: angel123
ports:
- "5432:5432"
redis:
container_name: angel-redis
image: redis:latest
ports:
- '6379:6379'
restart: unless-stopped
When I run docker-compose up I get error in logs for Redis:
2276:C 29 Mar 2022 20:32:52.005 # Failed opening the RDB file crontab (in server root dir /etc) for saving: Permission denied
1:M 29 Mar 2022 20:32:52.105 # Background saving error
I tried all the solutions on different platforms but couldn't make Redis work. A clue or direction make it work will be highly appreciated.
Also a little brief about the problem in detail why its happening would also be great help for readers and me. Looking forward.
I've encountered the same issue running a redis container on AWS ECS in a similar fashion.
I connected to the redis container and executed:
It returned the following:
I tried to remove the crontab file by running
config set dbfilename "dbfilename"
which failed with an error.I've found out that redis was running without a config file. So I added an extra volume for redis and created the file using
touch data/redis/config/redis.conf
.Then I've changed my compose file accordingly:
After rebooting the container I've run the same
CONFIG GET dbfilename
command but this time the crontab file was missing.Everything worked after that :)
Also make sure that you set a password for your redis server if it's accessible from the internet.