redis
This commit is contained in:
parent
a2e27c5316
commit
a233204766
2 changed files with 19 additions and 0 deletions
15
Dockerfile
15
Dockerfile
|
@ -1,2 +1,17 @@
|
||||||
FROM sutty/monit:latest
|
FROM sutty/monit:latest
|
||||||
MAINTAINER "f <f@sutty.nl>"
|
MAINTAINER "f <f@sutty.nl>"
|
||||||
|
|
||||||
|
RUN apk add --no-cache redis su-exec
|
||||||
|
|
||||||
|
COPY ./monit.conf /etc/monit.d/redis.conf
|
||||||
|
|
||||||
|
RUN sed -re "/^bind /d" -i /etc/redis.conf
|
||||||
|
RUN sed -re "/^protected-mode /d" -i /etc/redis.conf
|
||||||
|
RUN sed -re "/^logfile /d" -i /etc/redis.conf
|
||||||
|
RUN sed -re "s/^# (syslog-enabled).*/\1 yes/" -i /etc/redis.conf
|
||||||
|
RUN sed -re "s/^(appendonly).*/\1 yes/" -i /etc/redis.conf
|
||||||
|
RUN echo "pidfile /run/redis/redis.pid" >> /etc/redis.conf
|
||||||
|
RUN echo "daemonize yes" >> /etc/redis.conf
|
||||||
|
|
||||||
|
EXPOSE 6379
|
||||||
|
VOLUME "/var/lib/redis"
|
||||||
|
|
4
monit.conf
Normal file
4
monit.conf
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
check process redis with pidfile /run/redis/redis.pid
|
||||||
|
start program = "/sbin/su-exec redis /usr/bin/redis-server /etc/redis.conf"
|
||||||
|
stop program = "/usr/bin/redis-cli shutdown"
|
||||||
|
if failed port 6379 protocol redis 3 times within 5 cycles then restart
|
Loading…
Reference in a new issue