Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
beagle-rcache-image
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
market
beagle-rcache-image
Commits
4eb86fc2
Commit
4eb86fc2
authored
Mar 16, 2020
by
iamabhishek-dubey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added entrypoint.sh to support cluster and standalone
parent
a44b9b24
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
83 additions
and
0 deletions
+83
-0
Dockerfile
Dockerfile
+36
-0
entrypoint.sh
entrypoint.sh
+39
-0
redis.conf
redis.conf
+8
-0
No files found.
Dockerfile
0 → 100644
View file @
4eb86fc2
FROM
alpine:3.9
MAINTAINER
Opstree Solutions
LABEL
VERSION=1.0 \
ARCH=AMD64 \
DESCRIPTION="A production grade performance tuned docker image created by Opstree Solutions"
ARG
REDIS_DOWNLOAD_URL="http://download.redis.io/"
ARG
REDIS_VERSION="stable"
COPY
redis.conf /etc/redis/redis.conf
COPY
entrypoint.sh /usr/bin/entrypoint.sh
RUN
addgroup
-S
-g
1000 redis
&&
adduser
-S
-G
redis
-u
999 redis
&&
\
apk add
--no-cache
su-exec tzdata make curl build-base linux-headers
RUN
curl
-fL
-Lo
/tmp/redis-
${
REDIS_VERSION
}
.tar.gz
${
REDIS_DOWNLOAD_URL
}
/redis-
${
REDIS_VERSION
}
.tar.gz
&&
\
cd
/tmp
&&
\
tar
xvzf redis-
${
REDIS_VERSION
}
.tar.gz
&&
\
cd
redis-
${
REDIS_VERSION
}
&&
\
make
&&
\
make
install
&&
\
mkdir
-p
/etc/redis
&&
\
cp
-f
*
.conf /etc/redis
&&
\
rm
-rf
/tmp/redis-
${
REDIS_VERSION
}*
VOLUME
["/data"]
WORKDIR
/data
EXPOSE
6379
ENTRYPOINT
["/usr/bin/entrypoint.sh"]
entrypoint.sh
0 → 100755
View file @
4eb86fc2
#!/bin/sh
set
-eu
set_redis_password
()
{
if
[
-z
"
${
REDIS_PASSWORD
}
"
]
;
then
echo
"Redis is running without password which is not recommended"
else
{
echo
masterauth
"
${
REDIS_PASSWORD
}
"
echo
requirepass
"
${
REDIS_PASSWORD
}
"
}
>>
/etc/redis/redis.conf
fi
}
redis_mode_setup
()
{
if
[
"
${
SETUP_MODE
}
"
=
"cluster"
]
;
then
{
echo
cluster-enabled
yes
echo
cluster-config-file nodes.conf
echo
cluster-node-timeout 5000
}
>>
/etc/redis/redis.conf
else
echo
"Setting up redis in standalone mode"
fi
}
start_redis
()
{
echo
"Starting redis service "
redis-server /etc/redis/redis.conf
}
main_function
()
{
set_redis_password
redis_mode_setup
start_redis
}
main_function
redis.conf
0 → 100644
View file @
4eb86fc2
bind
0
.
0
.
0
.
0
protected
-
mode
yes
tcp
-
backlog
511
timeout
0
tcp
-
keepalive
300
daemonize
no
supervised
no
pidfile
/
var
/
run
/
redis
.
pid
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment