comparison docker_legacy/prosody/Dockerfile @ 164:29873a41aae1

docker: new docker files are now in sat main repos, this one is legacy
author Goffi <goffi@goffi.org>
date Fri, 01 Jan 2021 18:33:52 +0100
parents
children
comparison
equal deleted inserted replaced
163:a63f6d360326 164:29873a41aae1
1 ###############################################################
2 # #
3 # Salut à Toi/Prosody #
4 # This Dockerfile build a Prosody version prepared for SàT #
5 # Salut à Toi is a multi-frontends multi-purposes XMPP client #
6 # #
7 ###############################################################
8
9 FROM salutatoi/sat_pubsub:latest
10
11 MAINTAINER Goffi <goffi@goffi.org>
12
13 ############################
14 # AUTOMATIC CONFIGURATION #
15 ############################
16
17
18 COPY scripts/container_server scripts/prosody /usr/local/bin/
19 RUN chown root:root /usr/local/bin/container_server && \
20 chmod 0555 /usr/local/bin/container_server && \
21 chown root:root /usr/local/bin/prosody && \
22 chmod 0555 /usr/local/bin/prosody
23
24 ########
25 # BASE #
26 ########
27
28 RUN apt-get install -y --no-install-recommends lsb-release && \
29
30 # we add prosody repository and key
31 echo deb http://packages.prosody.im/debian $(lsb_release -sc) main > /etc/apt/sources.list.d/prosody.list && \
32 python -c 'import urllib2;import subprocess as s;s.Popen(["apt-key","add","-"], stdin=s.PIPE).communicate(urllib2.urlopen("https://prosody.im/files/prosody-debian-packages.key").read())' && \
33 apt-get update && \
34
35 # and install prosody and apg (to generate passwords)
36 apt-get install -y apg prosody-trunk && \
37 apt-get clean && \
38
39 # prosody user need to access (and write) certificates
40 adduser prosody tls-cert && \
41
42 # prosody need to access /var/run to write it's pid
43 mkdir -p /var/run/prosody; chown prosody:adm /var/run/prosody
44
45 ###################
46 # PROSODY MODULES #
47 ###################
48
49 RUN cd /tmp && \
50 hg clone https://hg.prosody.im/prosody-modules/ prosody-modules && \
51 cd prosody-modules && \
52 for mod in privilege delegation ipcheck http_upload;do cp mod_$mod/mod_$mod.lua /usr/lib/prosody/modules;done && \
53 cd /tmp && rm -rf prosody-modules
54
55 #################
56 # CONFIGURATION #
57 #################
58
59 ADD prosody.cfg.lua /etc/prosody/prosody_sat_cfg/
60 RUN cd /etc/prosody && chown -R prosody:prosody prosody_sat_cfg && \
61 ln -fs prosody_sat_cfg/prosody.cfg.lua prosody.cfg.lua && \
62
63 ###############
64 # CERTIFICATE #
65 ###############
66
67 # We want to use the certificates in /usr/share/sat/certificates
68 # and we don't want any certificate in the image,
69 # they'll be generated at launch or mounted in container
70 rm -rf /etc/localhost.key /etc/prosody/certs/*
71
72 #########
73 # PORTS #
74 #########
75
76 # client to server (C2S),
77 # server to server (S2S),
78 # HTTP upload,
79 # and HTTP upload (HTTPS)
80 EXPOSE 5222 5269 5280 5281
81
82 ##########
83 # LAUNCH #
84 ##########
85
86 USER prosody
87
88 ENTRYPOINT ["prosody"]