Dockerfile

1
#######
2
 
3
FROM debian:trixie-slim AS build
4
 
5
LABEL org.opencontainers.image.authors="Matthew Wild <mwild1@gmail.com>"
6
 
7
RUN apt-get update \
8
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9
        lua5.4 \
10
        lua-filesystem \
11
        make \
12
        mercurial \
13
        ca-certificates \
14
        bsdextrautils \
15
        libicu-dev \
16
        liblua5.4-dev \
17
        libssl-dev \
18
        build-essential \
19
    && rm -rf /var/lib/apt/lists/*
20
 
21
WORKDIR /tmp/build
22
 
23
RUN hg clone -b 13.0 https://hg.prosody.im/trunk prosody
24
 
25
RUN cd prosody && ./configure && make
26
 
27
# Verse's upstream repository is currently offline, so a local checkout
28
# must be supplied as a named build context, e.g.:
29
#   docker build --build-context verse=../verse .
30
COPY --from=verse . verse
31
 
32
ADD . riddim
33
 
34
# Verse's default build leaves the prosody.* libraries to be loaded at
35
# runtime from the Prosody tree copied into the runtime image below
36
RUN cd verse && lua5.4 ../riddim/buildscripts/squish && cp verse.lua ..
37
 
38
RUN cd riddim && lua5.4 buildscripts/squish && cp riddim.lua ..
39
 
40
#########
41
 
42
FROM debian:trixie-slim
43
 
44
LABEL org.opencontainers.image.authors="Matthew Wild <mwild1@gmail.com>"
45
 
46
RUN apt-get update \
47
    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
48
        lua5.4 \
49
        lua-filesystem \
50
        lua-socket \
51
        lua-sec \
52
        lua-expat \
53
        ca-certificates \
54
        libicu76 \
55
        lua-unbound \
56
        lua-system \
57
    && rm -rf /var/lib/apt/lists/*
58
 
59
WORKDIR /opt/riddim
60
 
61
COPY --from=build /tmp/build/verse.lua /opt/riddim/verse.lua
62
COPY --from=build /tmp/build/riddim.lua /opt/riddim/riddim.lua
63
COPY --from=build /tmp/build/prosody/net/ /usr/local/lib/lua/5.4/prosody/net/
64
COPY --from=build /tmp/build/prosody/util/ /usr/local/lib/lua/5.4/prosody/util/
65
 
66
ADD config.docker.lua /etc/riddim/config.lua
67
 
68
ENTRYPOINT ["/usr/bin/lua5.4", "riddim.lua"]
69
 
70
USER nobody
71
 
72
VOLUME /etc/riddim
73
 
74
CMD ["/etc/riddim/config.lua"]