ARG MAX_MEMORY=100mb ARG ALPINE_VERSION=3.13.6 ARG BASE_IMAGE=sutty/monit FROM ${BASE_IMAGE}:${ALPINE_VERSION} AS build MAINTAINER "f " ARG REDIS_VERSION=6.2.7 ARG MAX_MEMORY=100mb RUN apk add --no-cache redis~${REDIS_VERSION} 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 echo "pidfile /run/redis/redis.pid" >> /etc/redis.conf RUN echo "daemonize yes" >> /etc/redis.conf RUN echo "protected-mode no" >> /etc/redis.conf RUN echo "maxmemory-policy allkeys-lfu" >> /etc/redis.conf RUN echo "maxmemory ${MAX_MEMORY}" >> /etc/redis.conf RUN echo "save \"\"" >> /etc/redis.conf ARG ALPINE_VERSION=3.13.6 ARG BASE_IMAGE=sutty/monit FROM ${BASE_IMAGE}:${ALPINE_VERSION} MAINTAINER "f " ARG REDIS_VERSION=6.2.7 RUN apk add --no-cache redis~${REDIS_VERSION} su-exec COPY --from=build /etc/redis.conf /etc/redis.conf COPY ./monit.conf /etc/monit.d/redis.conf COPY ./redisd.sh /usr/local/bin/redisd EXPOSE 6379 VOLUME "/var/lib/redis"