# build a redis docker, with the module
{% if redis_docker_override is defined %}
FROM {{redis_docker_override}}
{% else %}
FROM redisfab/redis:{{REDIS_VERSION}}-{{REDIS_ARCH}}-{{REDIS_OSNICK}}
{% endif %}
{% set LIBDIR= "/usr/lib/redis/modules" %}
WORKDIR /data
RUN mkdir -p {{LIBDIR}}

COPY --from=builder {{redis_module_srcpath}} {{LIBDIR}}

{{ redis_docker_extra_content }}

EXPOSE 6379
CMD ["redis-server", "--loadmodule", "{{LIBDIR}}/{{redis_module}} "]
