There was an error while loading. Please reload this page.
1 parent a15b40c commit a0def17Copy full SHA for a0def17
docker/redis/Dockerfile
@@ -4,8 +4,10 @@ RUN addgroup -S redis && adduser -S -G redis redis
4
RUN apk add --no-cache redis
5
6
COPY redis.conf /etc/redis/redis.conf
7
+COPY entrypoint.sh /docker-entrypoint.sh
8
9
ENV PORT=6379
10
ENV SLAVEOF=
11
12
+ENTRYPOINT ["/docker-entrypoint.sh"]
13
CMD ["redis-server", "/etc/redis/redis.conf"]
docker/redis/entrypoint.sh
@@ -0,0 +1,10 @@
1
+#!/bin/sh
2
+sed -i.bak "s/^port .*$/port ${PORT}/" /etc/redis/redis.conf && rm /etc/redis/redis.conf.bak
3
+if [ "x$SLAVEOF" != x ];then
+echo "slaveof $SLAVEOF" >> /etc/redis/redis.conf
+fi
+
+chown redis:redis /etc/redis/redis.conf
+cat /etc/redis/redis.conf
+echo $@
+exec $@
0 commit comments