-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (54 loc) · 1.21 KB
/
Dockerfile
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
ARG BASE_IMAGE=alpine:3.19
# -- STAGE 1 [build] --
FROM ${BASE_IMAGE} AS build
WORKDIR /build
RUN apk add --no-cache \
build-base \
linux-headers \
lua5.4-dev \
libidn-dev \
openssl-dev \
libidn-dev
COPY ./prosody /build
RUN ./configure \
--prefix=/ \
--sysconfdir=/etc/prosody \
--libdir=/lib \
--datadir=/var/lib/prosody \
--lua-version=5.4 \
--lua-suffix=5.4 \
--idn-library=idn
RUN make
RUN make install
# -- STAGE 2 [run] --
FROM ${BASE_IMAGE} AS run
RUN apk add --no-cache \
libidn \
lua5.4 \
lua5.4-expat \
lua5.4-socket \
lua5.4-filesystem \
lua5.4-sec \
lua5.4-unbound
COPY --from=build /bin/prosody bin/
COPY --from=build /bin/prosodyctl bin/
COPY --from=build /lib/prosody/ /lib/prosody/
COPY ./plugins/*/ /usr/local/lib/prosody/modules/
RUN addgroup -S prosody
RUN adduser --no-create-home -S prosody -G prosody
RUN mkdir \
/var/lib/prosody/ \
/var/run/prosody/
RUN chown prosody:prosody \
/var/lib/prosody/ \
/var/run/prosody/
VOLUME /etc/prosody/
VOLUME /var/lib/prosody/
# [public] Client connections
EXPOSE 5222/tcp
# [public] Server-to-server connections
EXPOSE 5269/tcp
# [private] HTTP
EXPOSE 5280/tcp
USER prosody:prosody
ENTRYPOINT ["prosody"]