Skip to content

Commit

Permalink
add custom redis container to avoid write issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Mick Vermeulen authored and Mick Vermeulen committed Sep 21, 2020
1 parent 99f8656 commit 0de6006
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Redis.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM redis:alpine
WORKDIR /redis

COPY redis.conf /usr/local/etc/redis/redis.conf
COPY redis.sh ./

RUN chmod +x redis.sh
2 changes: 1 addition & 1 deletion Uchu
Submodule Uchu updated from be3382 to 56ef54
19 changes: 14 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
restart: always
volumes:
- ${DATA_FOLDER}:/var/lib/postgresql/data
expose:
- 5432
# Uncomment this if you wish to use adminer
# adminer:
# image: adminer
Expand All @@ -16,12 +18,19 @@ services:
# ports:
# - ${ADMINER_PORT}:8080
redis:
image: redis:6.0.8-alpine
env_file:
build:
context: .
dockerfile: Redis.Dockerfile
env_file:
- .env
restart: always
volumes:
- ${DATA_FOLDER}:/data
image: myredis
privileged: true
command: sh -c "./redis.sh"
volumes:
- ${DATA_FOLDER}:/data:rw
expose:
- 6379
restart: always
uchu:
build:
context: .
Expand Down
Empty file added redis.conf
Empty file.
8 changes: 8 additions & 0 deletions redis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

sysctl -w net.core.somaxconn=512

sysctl vm.overcommit_memory=1

redis-server /usr/local/etc/redis/redis.conf --bind 0.0.0.0

0 comments on commit 0de6006

Please sign in to comment.