-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(reids): using official redis:5-alpine docker image
- Loading branch information
1 parent
5d2308c
commit e897f3d
Showing
3 changed files
with
9 additions
and
35 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 |
---|---|---|
@@ -1,28 +1,8 @@ | ||
FROM quay.io/deis/base:v0.3.6 | ||
FROM redis:5-alpine | ||
|
||
COPY . / | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends redis-server && \ | ||
# cleanup | ||
apt-get clean -y && \ | ||
# package up license files if any by appending to existing tar | ||
COPYRIGHT_TAR='/usr/share/copyrights.tar'; \ | ||
gunzip -f $COPYRIGHT_TAR.gz; tar -rf $COPYRIGHT_TAR /usr/share/doc/*/copyright; gzip $COPYRIGHT_TAR && \ | ||
rm -rf \ | ||
/usr/share/doc \ | ||
/usr/share/man \ | ||
/usr/share/info \ | ||
/usr/share/locale \ | ||
/var/lib/apt/lists/* \ | ||
/var/cache/debconf/* \ | ||
/usr/lib/x86_64-linux-gnu/gconv/IBM* \ | ||
/usr/lib/x86_64-linux-gnu/gconv/EBC* && \ | ||
bash -c "mkdir -p /usr/share/man/man{1..8}" && \ | ||
chown -R redis:redis /etc/redis /var/lib/redis /var/log/redis | ||
|
||
USER redis | ||
WORKDIR /var/lib/redis | ||
|
||
CMD ["/bin/boot"] | ||
EXPOSE 6379 |
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 |
---|---|---|
@@ -1,25 +1,16 @@ | ||
#!/usr/bin/env bash | ||
#!/usr/bin/env sh | ||
|
||
set -eof pipefail | ||
|
||
REDIS_CONFIG_FILE=/etc/redis/redis.conf | ||
|
||
# Do not daemonize | ||
sed -i "s/daemonize yes/daemonize no/" $REDIS_CONFIG_FILE | ||
|
||
# Bind to 0.0.0.0 | ||
sed -i "s/bind 127.0.0.1/bind 0.0.0.0/" $REDIS_CONFIG_FILE | ||
|
||
# Log to stdout | ||
sed -i "s:logfile /var/log/redis/redis-server.log:logfile \"\":" $REDIS_CONFIG_FILE | ||
|
||
# Set password | ||
REDIS_PASSWORD_FILE=/var/run/secrets/deis/redis/creds/password | ||
if [ -e $REDIS_PASSWORD_FILE ]; then | ||
REDIS_PASSWORD="$(cat /var/run/secrets/deis/redis/creds/password)" | ||
if [ ! -z "$REDIS_PASSWORD" ]; then | ||
sed -i "s/# requirepass foobared/requirepass $REDIS_PASSWORD/" $REDIS_CONFIG_FILE | ||
fi | ||
REDIS_PASSWORD="$(cat /var/run/secrets/deis/redis/creds/password)" | ||
if [ ! -z "$REDIS_PASSWORD" ]; then | ||
echo "requirepass $REDIS_PASSWORD" >> REDIS_CONFIG_FILE | ||
fi | ||
fi | ||
|
||
exec redis-server $REDIS_CONFIG_FILE |
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,3 @@ | ||
daemonize no | ||
bind 0.0.0.0 | ||
logfile "" |