annotate docker/libervia/Dockerfile @ 124:8ea34bd97286

CR de l'AG ordinaire 2016 à Prague
author souliane <souliane@mailoo.org>
date Fri, 14 Oct 2016 18:38:33 +0200
parents 8b228fd053bc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
1 ####################################################################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
2 # #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
3 # Salut à Toi/Libervia #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # This Dockerfile build Libervia, the web frontend for Salut à Toi #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
5 # Salut à Toi is a multi-frontends multi-purposes XMPP client #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
6 # #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
7 ####################################################################
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
8
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
9 FROM salutatoi/media:latest
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
10
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
11 MAINTAINER Goffi <goffi@goffi.org>
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
12
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
13 #####################
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
14 # FIRST LAUNCH TEST #
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
15 #####################
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
16
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
17 COPY scripts/libervia_cont_launch /usr/bin/
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
18
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
19 RUN chown root:root /usr/bin/libervia_cont_launch && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
20 chmod 0555 /usr/bin/libervia_cont_launch && \
80
686a8c982c3f docker: updated Dockerfiles:
Goffi <goffi@goffi.org>
parents: 29
diff changeset
21
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
22 #########
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
23 # D-Bus #
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
24 #########
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
25
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
26 cp /usr/local/bin/dbus_wrap /usr/local/bin/libervia_cont_launch && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
27
85
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
28 #################
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
29 # CONFIGURATION #
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
30 #################
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
31
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
32 # we want to use certificates in /usr/share/sat/certificates
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
33 echo "\n[libervia]\n\
85
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
34 tls_private_key = /usr/share/sat/certificates/libervia.key\n\
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
35 tls_certificate = /usr/share/sat/certificates/libervia.crt\n\
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
36 connection_type = both\n\
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
37 redirect_to_https = 0" >> /etc/sat.conf
bcba1966e6db docker: certificate generation + various improvments:
Goffi <goffi@goffi.org>
parents: 80
diff changeset
38
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
39 ################
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
40 # dependencies #
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
41 ################
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
42
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
43 RUN pip install txJSON-RPC && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
44
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
45 apt-get install -y --no-install-recommends python-jinja2 && apt-get clean && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
46
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
47 ###########
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
48 # PYJAMAS #
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
49 ###########
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
50
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
51 cd /tmp && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
52
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
53 # as the situation with pyjamas is complicated, we get the archive from our own ftp
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
54 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()' && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
55
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
56 cd pyjamas && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
57
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
58 python bootstrap.py && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
59
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
60 ln -s /tmp/pyjamas/bin/pyjsbuild /usr/local/bin/pyjsbuild && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
61
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
62 ############
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
63 # LIBERVIA #
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
64 ############
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
65
106
8b228fd053bc docker (base, libervia): use new getRepositoryData ability to save data in a .hg_data file
Goffi <goffi@goffi.org>
parents: 105
diff changeset
66 cd /tmp && hg clone https://repos.goffi.org/libervia && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
67
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
68 cd libervia && \
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
69
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
70 python setup.py install && \
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
71
106
8b228fd053bc docker (base, libervia): use new getRepositoryData ability to save data in a .hg_data file
Goffi <goffi@goffi.org>
parents: 105
diff changeset
72 # as for SàT backend, we save repos data
8b228fd053bc docker (base, libervia): use new getRepositoryData ability to save data in a .hg_data file
Goffi <goffi@goffi.org>
parents: 105
diff changeset
73 # so Libervia can get repository version
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
74 # TODO: should be done in setup.py in the future
106
8b228fd053bc docker (base, libervia): use new getRepositoryData ability to save data in a .hg_data file
Goffi <goffi@goffi.org>
parents: 105
diff changeset
75 python -c 'from sat.tools import utils;utils.getRepositoryData("/tmp/libervia", is_path=True, save_dir_path="/usr/local/lib/python2.7/dist-packages/libervia")' && \
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
76
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
77 # some cleaning before finishing the layer
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
78 cd /tmp && rm -rf libervia pyjamas /usr/local/bin/pyjsbuild
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
79
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
80 #########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
81 # Ports #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
82 #########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
83
105
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
84 # HTTP and HTTPS
b69056368901 docker: images optimisation:
Goffi <goffi@goffi.org>
parents: 85
diff changeset
85 EXPOSE 8080 8443
21
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
86
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
87 ##########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
88 # LAUNCH #
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
89 ##########
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
90
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
91 USER sat
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
92
0e78c8a4626e Added Dockerfiles to create Docker images for easy installation + scripts to manages them. see README for details.
Goffi <goffi@goffi.org>
parents:
diff changeset
93 ENTRYPOINT ["libervia_cont_launch", "fg"]