From 0de6006ebfbdc8418d5dec46034401628e025944 Mon Sep 17 00:00:00 2001 From: Mick Vermeulen Date: Mon, 21 Sep 2020 09:39:21 +0200 Subject: [PATCH] add custom redis container to avoid write issues --- Redis.Dockerfile | 7 +++++++ Uchu | 2 +- docker-compose.yaml | 19 ++++++++++++++----- redis.conf | 0 redis.sh | 8 ++++++++ 5 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 Redis.Dockerfile create mode 100644 redis.conf create mode 100644 redis.sh diff --git a/Redis.Dockerfile b/Redis.Dockerfile new file mode 100644 index 0000000..de6cc87 --- /dev/null +++ b/Redis.Dockerfile @@ -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 \ No newline at end of file diff --git a/Uchu b/Uchu index be33824..56ef54f 160000 --- a/Uchu +++ b/Uchu @@ -1 +1 @@ -Subproject commit be33824b7fcde69f87ac29ba720405adf00524dd +Subproject commit 56ef54f78d43e3c196ae4db555cef64127eace43 diff --git a/docker-compose.yaml b/docker-compose.yaml index fdb9c89..adf164b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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 @@ -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: . diff --git a/redis.conf b/redis.conf new file mode 100644 index 0000000..e69de29 diff --git a/redis.sh b/redis.sh new file mode 100644 index 0000000..4eed194 --- /dev/null +++ b/redis.sh @@ -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 \ No newline at end of file