Skip to content

Instantly share code, notes, and snippets.

@ccw
Created December 9, 2016 08:55
Show Gist options
  • Save ccw/8fd74f9afb60b4f1df5e443e8fba7cc0 to your computer and use it in GitHub Desktop.
Save ccw/8fd74f9afb60b4f1df5e443e8fba7cc0 to your computer and use it in GitHub Desktop.
Redis Sentinel Docker
FROM redis:3-alpine
COPY master.conf /usr/local/etc/redis/master.conf
COPY slave.conf /usr/local/etc/redis/slave.conf
COPY sentinel.conf /usr/local/etc/redis/sentinel.conf
RUN mkdir -p /var/log/redis
RUN mkdir -p /var/run/redis
RUN mkdir -p /var/lib/redis
RUN chown redis:redis /var/log/redis
RUN chown redis:redis /var/run/redis
RUN chown redis:redis /var/lib/redis
EXPOSE 6379 16379 26379
RUN redis-server /usr/local/etc/redis/master.conf
RUN redis-server /usr/local/etc/redis/slave.conf
CMD [ "redis-sentinel", "/usr/local/etc/redis/sentinel.conf" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment