view docker_legacy/libervia/Dockerfile @ 171:a213053a03be

flatpak: update files following names change + Python 3 update: - `build_manifest.py` has been fixed to work with recent SàT/Libervia - filenames/scripts have been udpated to reflect project name change - installation now uses `requirements.txt` when dev version is requested - there are now 3 types of commands wrapper: * `libervia_wrapper.py` uses `pb` bridge, starts backend before frontend, and stops it when frontend is stopped. It's used by `Libervia Desktop` (Cagou) * `libervia_wrapper-dbus.py` uses `dbus` bridge, starts backend before frontend, and stops it when frontend is stopped. It's used for `Libervia TUI` (Primitivus) * `libervia_wrapper-dbus.py` uses `dbus` bridge, starts backend if necessary and doesn't stop it (to avoid waiting for backend start next time). It's used by `Libervia CLI` (jp).
author Goffi <goffi@goffi.org>
date Tue, 30 Nov 2021 21:42:06 +0100
parents 29873a41aae1
children
line wrap: on
line source

####################################################################
#                                                                  #
#                       Salut à Toi/Libervia                       #
# This Dockerfile build Libervia, the web frontend for Salut à Toi #
#   Salut à Toi is a multi-frontends multi-purposes XMPP client    #
#                                                                  #
####################################################################

FROM salutatoi/media:latest

MAINTAINER Goffi <goffi@goffi.org>

#####################
# FIRST LAUNCH TEST #
#####################

COPY scripts/libervia_cont_launch /usr/bin/

RUN chown root:root /usr/bin/libervia_cont_launch && \
chmod 0555 /usr/bin/libervia_cont_launch && \

#########
# D-Bus #
#########

cp /usr/local/bin/dbus_wrap /usr/local/bin/libervia_cont_launch && \

#################
# CONFIGURATION #
#################

# we want to use certificates in /usr/share/sat/certificates
echo "\n[libervia]\n\
tls_private_key = /usr/share/sat/certificates/libervia.key\n\
tls_certificate = /usr/share/sat/certificates/libervia.crt\n\
connection_type = both\n\
redirect_to_https = 0" >> /etc/sat.conf

################
# dependencies #
################

RUN pip install txJSON-RPC && \

apt-get install -y --no-install-recommends python-jinja2 && apt-get clean && \

###########
# PYJAMAS #
###########

cd /tmp && \

# as the situation with pyjamas is complicated, we get the archive from our own ftp
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()' && \

cd pyjamas && \

python bootstrap.py && \

ln -s /tmp/pyjamas/bin/pyjsbuild /usr/local/bin/pyjsbuild && \

############
# LIBERVIA #
############

cd /tmp && hg clone https://repos.goffi.org/libervia && \

cd libervia && \

python setup.py install && \

# as for SàT backend, we save repos data
# so Libervia can get repository version
# TODO: should be done in setup.py in the future
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")' && \

# some cleaning before finishing the layer
cd /tmp && rm -rf libervia pyjamas /usr/local/bin/pyjsbuild

#########
# Ports #
#########

# HTTP and HTTPS
EXPOSE 8080 8443

##########
# LAUNCH #
##########

USER sat

ENTRYPOINT ["libervia_cont_launch", "fg"]