mirror of
https://github.com/mCaptcha/cache.git
synced 2024-11-24 01:15:31 +03:00
30 lines
610 B
Docker
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"]
|