-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 98cc181
Showing
5 changed files
with
2,380 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.