Mercurial > sat_docs
view docker/prosody/Dockerfile @ 80:686a8c982c3f
docker: updated Dockerfiles:
- use HTTPS URLs instead of HTTP
- prosody image know use prosody Debian repository instead of Debian Jessie version, prosody 0.10 is used
- prosody configuration is now in prosody directory next to Dockerfile, instead of using difficult to maintain sed calls
- community modules are downloaded from mercurial, and only needed ones are kept
- no more remote-roster hack \o/
- pubsub component is not at pubsub.[domain] (was sat-pubsub before)
- SàT media are gotten from hg instead of ftp, so they are up-to-date with SàT version
- libervia image now use pip for txJSON-RPC
- fixed now needed jinja2 installation
- fixed libervia/admin accounts auto-creation script
- fixed uid/gid for prosody in data image
- removed not needed anymore nox option in base image
- added python-pip in base image
- docker images now work with current dev version (0.6.0D)
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 12 Feb 2016 20:24:24 +0100 |
parents | 0e78c8a4626e |
children | bcba1966e6db |
line wrap: on
line source
############################################################### # # # Salut à Toi/Prosody # # This Dockerfile build a Prosody version prepared for SàT # # Salut à Toi is a multi-frontends multi-purposes XMPP client # # # ############################################################### FROM salutatoi/base:latest MAINTAINER Goffi <goffi@goffi.org> ######## # BASE # ######## RUN apt-get install -y --no-install-recommends lsb-release # we add prosody repository and key RUN echo deb http://packages.prosody.im/debian $(lsb_release -sc) main > /etc/apt/sources.list.d/prosody.list RUN 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())' RUN apt-get update # and install prosody and apg (to generate passwords) RUN apt-get install -y apg prosody-0.10 RUN apt-get clean ################### # PROSODY MODULES # ################### WORKDIR /tmp RUN hg clone https://hg.prosody.im/prosody-modules/ prosody-modules WORKDIR prosody-modules RUN for mod in privilege delegation ipcheck http_upload;do cp mod_$mod/mod_$mod.lua /usr/lib/prosody/modules;done WORKDIR /tmp RUN rm -rf prosody-modules ################# # CONFIGURATION # ################# WORKDIR /etc/prosody # we keep up-to-date configuration for this image on the repository RUN python -c 'import urllib2;f=open("prosody.cfg.lua","w");f.write(urllib2.urlopen("https://repos.goffi.org/sat_docs/raw-file/tip/docker/prosody/prosody.cfg.lua").read())' ############### # CERTIFICATE # ############### # We want to use the certificat in /usr/share/sat # but we do a link to be sure that there is a certificate RUN ln -s /etc/prosody/certs/localhost.key /usr/share/sat/libervia.key; ln -s /etc/prosody/certs/localhost.crt /usr/share/sat/libervia.crt ############################ # AUTOMATIC CONFIGURATION # ############################ # this script allow to call prosodyctl and get configuration variables from linked containers RUN echo '#!/usr/bin/env python2\n\ import subprocess, SimpleXMLRPCServer, os\n\ def prosodyctl(command, profile, pwd):\n\ process = subprocess.Popen(["prosodyctl", command, profile], stdin=subprocess.PIPE)\n\ if pwd:\n\ process.communicate("%s\\n%s"%(pwd,pwd))\n\ return process.wait()\n\ def getenv(variable):\n\ assert variable in ("SAT_PUBSUB_SECRET","SAT_SALUT_SECRET","DOMAIN")\n\ return os.getenv(variable)\n\ server = SimpleXMLRPCServer.SimpleXMLRPCServer(("0.0.0.0", 9999))\n\ server.register_function(prosodyctl, "prosodyctl")\n\ server.register_function(getenv, "getenv")\n\ server.serve_forever()' > /usr/local/bin/container_server && chmod 0555 /usr/local/bin/container_server # the following script is used to automatically generate passwords for components RUN echo '#!/bin/sh\n\ export SAT_PUBSUB_SECRET=$(apg -n 1)\n\ export SAT_SALUT_SECRET=$(apg -n 1)\n\ if [ -z $DOMAIN ]; then\n\ export DOMAIN="libervia.int"\n\ fi\n\ container_server&\n\ echo "domain used: $DOMAIN\n"\n\ /usr/bin/prosody $@' > /usr/local/bin/prosody && chmod +x /usr/local/bin/prosody ######### # PORTS # ######### # client to server (C2S) EXPOSE 5222 # server to server (S2S) EXPOSE 5269 ########## # LAUNCH # ########## # prosody need to access /var/run to write it's pid RUN mkdir -p /var/run/prosody; chown prosody:adm /var/run/prosody USER prosody ENTRYPOINT ["prosody"]