Mercurial > sat_docs
comparison docker/libervia/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 | b27e7f9ad479 |
children | bcba1966e6db |
comparison
equal
deleted
inserted
replaced
79:694fd34ff0b3 | 80:686a8c982c3f |
---|---|
12 | 12 |
13 ############## | 13 ############## |
14 # txJSON-RPC # | 14 # txJSON-RPC # |
15 ############## | 15 ############## |
16 | 16 |
17 WORKDIR /tmp/txjsonrpc | 17 RUN pip install txJSON-RPC |
18 | |
19 # wget and tar are not installed, so we use python | |
20 RUN python -c 'import urllib2,tarfile,cStringIO;tar=tarfile.open(fileobj=cStringIO.StringIO(urllib2.urlopen("https://pypi.python.org/packages/source/t/txJSON-RPC/txJSON-RPC-0.3.1.tar.gz").read()));tar.extractall()' | |
21 | |
22 # we don't need setuptools, so we just install through python | |
23 RUN cd tx*; sed -i "s/from setuptools/from distutils.core/" setup.py; python setup.py install | |
24 | |
25 WORKDIR /tmp | |
26 | |
27 RUN rm -rf txjsonrpc | |
28 | 18 |
29 ########### | 19 ########### |
30 # PYJAMAS # | 20 # PYJAMAS # |
31 ########### | 21 ########### |
32 | 22 |
33 WORKDIR /usr/share | 23 WORKDIR /usr/share |
34 | 24 |
35 # as the situation with pyjamas is complicated, we get the archive from our own ftp | 25 # as the situation with pyjamas is complicated, we get the archive from our own ftp |
36 RUN python -c 'import urllib2,tarfile,cStringIO;tar=tarfile.open(fileobj=cStringIO.StringIO(urllib2.urlopen("http://ftp.goffi.org/pyjamas/pyjamas.tar.bz2").read()));tar.extractall()' | 26 RUN python -c 'import urllib2,tarfile,cStringIO;tar=tarfile.open(fileobj=cStringIO.StringIO(urllib2.urlopen("https://ftp.goffi.org/pyjamas/pyjamas.tar.bz2").read()));tar.extractall()' |
37 | 27 |
38 WORKDIR pyjamas | 28 WORKDIR pyjamas |
39 | 29 |
40 RUN python bootstrap.py | 30 RUN python bootstrap.py |
41 | 31 |
45 # LIBERVIA # | 35 # LIBERVIA # |
46 ############ | 36 ############ |
47 | 37 |
48 WORKDIR /tmp | 38 WORKDIR /tmp |
49 | 39 |
50 RUN hg clone http://repos.goffi.org/libervia | 40 RUN apt-get install -y --no-install-recommends python-jinja2 |
41 | |
42 RUN hg clone https://repos.goffi.org/libervia | |
51 | 43 |
52 WORKDIR libervia | 44 WORKDIR libervia |
53 | 45 |
54 RUN python setup.py install | 46 RUN python setup.py install |
55 | 47 |
74 return "".join(random.choice(chars) for _ in range(length))\n\ | 66 return "".join(random.choice(chars) for _ in range(length))\n\ |
75 sat=DBus.DBusBridgeFrontend()\n\ | 67 sat=DBus.DBusBridgeFrontend()\n\ |
76 sat.getReady()\n\ | 68 sat.getReady()\n\ |
77 admin_email = sat.getConfig(account.CONFIG_SECTION, "admin_email") or account.default_conf["admin_email"]\n\ | 69 admin_email = sat.getConfig(account.CONFIG_SECTION, "admin_email") or account.default_conf["admin_email"]\n\ |
78 for profile in ["libervia", "admin"]:\n\ | 70 for profile in ["libervia", "admin"]:\n\ |
79 if not sat.getProfileName(profile):\n\ | 71 try:\n\ |
72 sat.getProfileName(profile)\n\ | |
73 except Exception as e:\n\ | |
80 print "{} profile doesn'\''t exists, creating it".format(profile)\n\ | 74 print "{} profile doesn'\''t exists, creating it".format(profile)\n\ |
81 print "registering {}@{}".format(profile, sat.getNewAccountDomain())\n\ | 75 print "registering {}@{}".format(profile, sat.getNewAccountDomain())\n\ |
82 pwd = generate_pwd()\n\ | 76 pwd = generate_pwd()\n\ |
83 if profile == "libervia":\n\ | 77 if profile == "libervia":\n\ |
84 config.fixConfigOption("libervia", "passphrase", pwd)\n\ | 78 config.fixConfigOption("libervia", "passphrase", pwd)\n\ |
85 elif profile == "admin":\n\ | 79 elif profile == "admin":\n\ |
86 with open("/home/sat/ADMIN_PWD", "w") as f:\n\ | 80 with open("/home/sat/ADMIN_PWD", "w") as f:\n\ |
87 f.write("%s\n" % pwd)\n\ | 81 f.write("%s\\n" % pwd)\n\ |
88 sat.registerSatAccount(admin_email, pwd, profile)\n\ | 82 sat.registerSatAccount(admin_email, pwd, profile)\n\ |
89 os.execvp("libervia", ["libervia"] + sys.argv[1:])\n\ | 83 os.execvp("libervia", ["libervia"] + sys.argv[1:])\n\ |
90 ' > /usr/bin/libervia_cont_launch && chmod 555 /usr/bin/libervia_cont_launch | 84 ' > /usr/bin/libervia_cont_launch && chmod 555 /usr/bin/libervia_cont_launch |
91 | 85 |
92 ######### | 86 ######### |