Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
azagramac committed Dec 7, 2023
0 parents commit 98cc181
Show file tree
Hide file tree
Showing 5 changed files with 2,380 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM redis:7.2.3-alpine3.18

WORKDIR /redis

COPY init.sh ./
COPY redis.conf ./

LABEL version="7.2.3"
LABEL org.opencontainers.image.authors="https://azagramac.gitbook.io/"

EXPOSE 6379/tcp

RUN chmod +x init.sh

ENTRYPOINT ["redis-server", "/redis/redis.conf", "--loglevel", "verbose"]
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
![image](https://github.com/AzagraMac/RedisDocker/assets/571796/5ebb3b2a-e77b-431a-8eb9-dcc5e768bdd2)

## Build

git clone https://github.com/AzagraMac/RedisDocker.git
cd RedisDocker

docker build -t yourname/redis:tag


## Launch

docker compose up -d

## Loggin

docker logs -f redis
23 changes: 23 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: '3.8'
services:
cache:
image: azagramac/redis:7.2.3-alpine3.18
container_name: redis
privileged: true
network_mode: "host"
restart: always
ports:
- '6379:6379'
command: sh -c "./init.sh"
volumes:
- cache:/data
deploy:
resources:
limits:
memory: 128M
reservations:
memory: 64M

volumes:
cache:
driver: local
15 changes: 15 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# WARNING overcommit_memory is set to 0! Background save may fail under low memory condition.
# To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot
# or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
# The overcommit_memory has 3 options.
# 0, the system kernel check if there is enough memory to be allocated to the process or not,
# if not enough, it will return errors to the process.
# 1, the system kernel is allowed to allocate the whole memory to the process
# no matter what the status of memory is.
# 2, the system kernel is allowed to allocate a memory whose size could be bigger than
# the sum of the size of physical memory and the size of exchange workspace to the process.

sysctl vm.overcommit_memory=1

# Start redis server
redis-server /redis/redis.conf --loglevel verbose #--requirepass YOUR_PASS
Loading

0 comments on commit 98cc181

Please sign in to comment.