comparison docker/salut/Dockerfile @ 21:0e78c8a4626e

Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
author Goffi <goffi@goffi.org>
date Sun, 19 Oct 2014 15:14:40 +0200
parents
children 686a8c982c3f
comparison
equal deleted inserted replaced
20:703a394b9780 21:0e78c8a4626e
1 ###############################################################
2 # #
3 # Salut à Toi/salut #
4 # This Dockerfile build a Salut directory prepared for SàT #
5 # Salut à Toi is a multi-frontends multi-purposes XMPP client #
6 # #
7 ###############################################################
8
9 FROM salutatoi/base:latest
10
11 MAINTAINER Goffi <goffi@goffi.org>
12
13 ########
14 # BASE #
15 ########
16
17 RUN apt-get clean
18
19 # This script launch Salut with domain and secret gotten from prosody container
20 # it make the configuration more easy
21 RUN echo '#!/usr/bin/env python2\n\
22 import os, xmlrpclib\n\
23 SALUT_PATH="/usr/share/sat_salut/"\n\
24 os.chdir("/home/sat")\n\
25 proxy = xmlrpclib.ServerProxy("http://prosody:9999/")\n\
26 for var in ("DOMAIN", "SAT_SALUT_SECRET"):\n\
27 os.environ[var] = proxy.getenv(var)\n\
28 os.environ["PYTHONPATH"] = SALUT_PATH\n\
29 os.execlp("twistd", "twistd", "-ny", SALUT_PATH+"salut.tac")\n\
30 ' > /usr/local/bin/salut && chmod 0555 /usr/local/bin/salut
31
32 WORKDIR /usr/share
33
34 RUN hg clone http://repos.goffi.org/salut sat_salut && chown -R sat:sat sat_salut
35
36 WORKDIR sat_salut
37
38 USER sat
39
40 # configuration is really basic in salut, we just use environment to set data
41 RUN sed -i 's/^xmppcomponent =.*$/import os\nxmppcomponent = Component("prosody", 5347, "salut."+os.getenv("DOMAIN"), os.getenv("SAT_SALUT_SECRET"))/' salut.tac
42
43 ##########
44 # LAUNCH #
45 ##########
46
47 ENTRYPOINT ["salut"]