annotate docker/backend-dev/Dockerfile @ 3548:13e7ef106589

plugin XEP-0277: don't wrap `DataError` in `failure.Failure` in `parseCommentUrl` as it is not catched correctly: `failure.Failure` is subclass of `BaseException` but not of `Exception`, as a result `except Exception` doesn't catch it correctly. This is fixed by not wrapping `DataError` in `failure.Failure` anymore.
author Goffi <goffi@goffi.org>
date Fri, 04 Jun 2021 17:18:44 +0200
parents 73e04040d577
children 443b3a784eba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3445
fc83c4996c77 docker: use `slim` version of Debian as base for our images
Goffi <goffi@goffi.org>
parents: 3381
diff changeset
1 FROM debian:buster-slim
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
2
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
3 LABEL maintainer="Goffi <tmp_dockerfiles@goffi.org>"
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
4
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
5 ARG DEBIAN_FRONTEND=noninteractive
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 RUN apt-get update && apt-get upgrade -y && \
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8 apt-get install -y --no-install-recommends locales python3-dev python3-venv python3-wheel mercurial libxml2-dev libxslt-dev libcairo2-dev libjpeg-dev libgirepository1.0-dev libdbus-1-dev libdbus-glib-1-dev dbus-x11 cmake && \
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 \
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # will be used to put many SàT specific data
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
11 mkdir -p /usr/share/libervia/certificates && \
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 addgroup tls-cert --gid 9999 && \
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
13 chown :tls-cert /usr/share/libervia/certificates && \
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
14 chmod 2770 /usr/share/libervia/certificates && \
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # it's better to have a dedicated user
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
16 useradd -m libervia && adduser libervia tls-cert && \
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # we'll put all source there to have an easy mount point
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
18 mkdir /src && chown libervia:libervia /src && \
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
19 \
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 # we need UTF-8 locale
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen && \
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 \
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
23 # we need a TCP socket for D-Bus
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 sed -i "s&<listen>unix:tmpdir=/tmp</listen>&\0\n <listen>tcp:host=localhost,bind=*,port=55555,family=ipv4</listen>\n <auth>ANONYMOUS</auth>\n <allow_anonymous/>&" /usr/share/dbus-1/session.conf
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
25
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
26 ENV LC_ALL en_US.UTF-8
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
27
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
28 WORKDIR /home/libervia
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
29 USER libervia
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
30
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
31 RUN python3 -m venv libervia_env && libervia_env/bin/pip install -U pip wheel && cd /src && \
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32 # We install thoses packages in editable mode, so we can replace them easily with volumes.
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 # We need to move *.egg-info (generated by pip) out of src dirs, otherwise mounting
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 # local repos without it them cause troubles
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
35 hg clone https://repos.goffi.org/urwid-satext && ~/libervia_env/bin/pip install -e urwid-satext && \
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
36 mv urwid-satext/urwid_satext.egg-info ~/libervia_env/lib/python3.*/site-packages && \
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
37 hg clone https://repos.goffi.org/sat_tmp && ~/libervia_env/bin/pip install -e sat_tmp && \
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
38 mv sat_tmp/sat_tmp.egg-info ~/libervia_env/lib/python3.*/site-packages && \
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
39 hg clone https://repos.goffi.org/sat_templates && ~/libervia_env/bin/pip install -e sat_templates && \
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
40 mv sat_templates/sat_templates.egg-info ~/libervia_env/lib/python3.*/site-packages && \
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 hg clone https://repos.goffi.org/sat_media && \
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
42 hg clone https://repos.goffi.org/sat && ~/libervia_env/bin/pip install -e 'sat[SVG]' && \
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
43 mv sat/sat.egg-info ~/libervia_env/lib/python3.*/site-packages
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
44
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
45 ENV DBUS_SESSION_BUS_ADDRESS=tcp:host=backend,port=55555,family=ipv4
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
46 ENV PATH=/home/libervia/libervia_env/bin:$PATH
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
47
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
48 COPY --chown=root:root libervia.conf /etc/_libervia.conf
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
49 COPY --chown=libervia:libervia scripts/entrypoint.sh /home/libervia/
3381
127dde80a0a5 docker: dockers images, first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
50
3497
73e04040d577 docker: update following name changes:
Goffi <goffi@goffi.org>
parents: 3445
diff changeset
51 ENTRYPOINT ["/home/libervia/entrypoint.sh"]