forked from starkdg/Redis-ImageScout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-old
77 lines (63 loc) · 1.97 KB
/
Dockerfile-old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
######################################################################
# BUILD luxcium/imagescout
ARG REDIS_VER=6.2.6-v7-x86_64
ARG OSNICK=23.10
ARG OS=ubuntu:${OSNICK}
# #-------------------------------------------------------------------
# FROM redisfab/redis-stack-server:6.2.4-v1 AS redis
FROM redis/redis-stack-server:${REDIS_VER} AS redis
#
# #-------------------------------------------------------------------
FROM ${OS} AS builder
RUN set -ex;\
apt-get -q update ;\
apt-get install -y --no-install-recommends ca-certificates wget;\
apt-get install -y --no-install-recommends build-essential cmake
# FROM fedora:38 AS builder
# # Install dependencies and build the module
# RUN set -ex; \
# dnf upgrade -y \
# && dnf install -y \
# ca-certificates \
# wget \
# cmake \
# make \
# gcc \
# gcc-c++ \
# glibc-devel \
# glibc-headers \
# kernel-devel \
# kernel-headers \
# libstdc++-static \
# && dnf clean all \
# && rm -rf /var/cache/dnf
WORKDIR /build
COPY --from=redis /usr/local/ /usr/local/
ADD CMakeLists.txt *.h *.cpp *.hpp /build/
RUN set -ex; \
cmake -DCMAKE_BUILD_TYPE=Release . \
&& make
# #-------------------------------------------------------------------
#
# FROM redisfab/redis-stack-server:6.2.4-v1
FROM redis/redis-stack:${REDIS_VER}
WORKDIR /data
ENV LIBDIR /usr/lib/redis/modules
ENV SOCDIR /var/run/redis
ENV CONFDIR /etc/redis
RUN mkdir -p "${LIBDIR}" "${CONFDIR}" "${SOCDIR}"
COPY --from=builder /build/imgscout.so "${LIBDIR}"
COPY 6383.conf "${CONFDIR}"
# sudo useradd username
RUN useradd redis \
&& chmod 644 "${CONFDIR}"/6383.conf \
&& chown redis "${CONFDIR}"/6383.conf
# Create a UNIX socket file (optional)
RUN chown redis:redis "${SOCDIR}" \
&& chmod 775 "${SOCDIR}" \
&& touch "${SOCDIR}"/6383.sock \
&& chown redis:redis "${SOCDIR}"/6383.sock
EXPOSE 6383
CMD ["redis-server", "/etc/redis/6383.conf"]
# #-------------------------------------------------------------------
######################################################################