Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit f619a25

Browse files
authored
Merge pull request #24 from jdeathe/issue/20
CLOSES #20: Adds docker-compose configuration example.
2 parents 12b0793 + a11d8b1 commit f619a25

File tree

5 files changed

+53
-0
lines changed

5 files changed

+53
-0
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.env
2+
.env.example
13
.git
24
.gitignore
35
dist

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
REDIS_MAXMEMORY=64mb
2+
REDIS_MAXMEMORY_POLICY=allkeys-lru
3+
REDIS_MAXMEMORY_SAMPLES=5
4+
REDIS_OPTIONS=
5+
REDIS_TCP_BACKLOG=1024

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.env
12
dist

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ CentOS-7 7.5.1804 x86_64 - Redis 4.0.
1616
- Adds placeholder replacement of `RELEASE_VERSION` docker argument to systemd service unit template.
1717
- Adds consideration for event lag into test cases for unhealthy health_status events.
1818
- Adds port incrementation to Makefile's run template for container names with an instance suffix.
19+
- Adds docker-compose configuration example.
1920
- Removes use of `/etc/services-config` paths.
2021
- Removes X-Fleet section from etcd register template unit-file.
2122
- Removes the unused group element from the default container name.

docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# ------------------------------------------------------------------------------
2+
# Ref: https://docs.docker.com/compose/compose-file/
3+
#
4+
# Setup:
5+
# docker-compose build
6+
# docker-compose down
7+
#
8+
# Run Default example:
9+
# docker-compose up -d
10+
#
11+
# Redis usage:
12+
# docker-compose exec redis redis-cli --help
13+
# docker-compose exec redis redis-cli --stat
14+
# docker-compose exec redis redis-cli --lru-test 512
15+
# docker-compose exec redis redis-cli monitor
16+
# ------------------------------------------------------------------------------
17+
version: "3.0"
18+
services:
19+
redis:
20+
build:
21+
context: "."
22+
dockerfile: "Dockerfile"
23+
environment:
24+
REDIS_AUTOSTART_REDIS_BOOTSTRAP: "true"
25+
REDIS_AUTOSTART_REDIS_WRAPPER: "true"
26+
REDIS_MAXMEMORY: "${REDIS_MAXMEMORY}"
27+
REDIS_MAXMEMORY_POLICY: "${REDIS_MAXMEMORY_POLICY}"
28+
REDIS_MAXMEMORY_SAMPLES: "${REDIS_MAXMEMORY_SAMPLES}"
29+
REDIS_OPTIONS: "${REDIS_OPTIONS}"
30+
REDIS_TCP_BACKLOG: "${REDIS_TCP_BACKLOG}"
31+
image: "jdeathe/centos-ssh-redis:latest"
32+
ports:
33+
- "6379:6379"
34+
restart: "always"
35+
sysctls:
36+
net.core.somaxconn: "1024"
37+
net.ipv4.ip_local_port_range: "1024 65535"
38+
net.ipv4.route.flush: "1"
39+
ulimits:
40+
memlock: 82000
41+
nofile:
42+
soft: 524288
43+
hard: 1048576
44+
nproc: 65535

0 commit comments

Comments
 (0)