mCaptcha-cache/Dockerfile
2021-06-02 18:47:11 +05:30

30 lines
610 B
Docker

ARG REDIS_VER=6.2.2
# stretch|bionic|buster
ARG OSNICK=buster
# ARCH=x64|arm64v8|arm32v7
ARG ARCH=x64
FROM rust:latest as builder
WORKDIR /src
COPY . .
RUN set -ex; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends redis clang gcc
RUN cargo build --release
FROM redisfab/redis:${REDIS_VER}-${ARCH}-${OSNICK}
ARG REDIS_VER
ENV LIBDIR /usr/lib/redis/modules
WORKDIR /data
RUN mkdir -p "$LIBDIR"
COPY --from=builder /src/target/release/libcache.so "$LIBDIR"
EXPOSE 6379
CMD ["redis-server", "--loadmodule", "/usr/lib/redis/modules/libcache.so"]