docker: update following name changes:
`backend_e2e` now print properly backend logs
This commit is contained in:
parent
19da80743b
commit
363788de7d
3 changed files with 295 additions and 288 deletions
51
docker/backend-dev/Dockerfile
Normal file
51
docker/backend-dev/Dockerfile
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
FROM debian:buster-slim
|
||||
|
||||
LABEL maintainer="Goffi <tmp_dockerfiles@goffi.org>"
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get upgrade -y && \
|
||||
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 && \
|
||||
\
|
||||
# will be used to put many SàT specific data
|
||||
mkdir -p /usr/share/libervia/certificates && \
|
||||
addgroup tls-cert --gid 9999 && \
|
||||
chown :tls-cert /usr/share/libervia/certificates && \
|
||||
chmod 2770 /usr/share/libervia/certificates && \
|
||||
# it's better to have a dedicated user
|
||||
useradd -m libervia && adduser libervia tls-cert && \
|
||||
# we'll put all source there to have an easy mount point
|
||||
mkdir /src && chown libervia:libervia /src && \
|
||||
\
|
||||
# we need UTF-8 locale
|
||||
sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen && \
|
||||
\
|
||||
# we need a TCP socket for D-Bus
|
||||
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
|
||||
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
WORKDIR /home/libervia
|
||||
USER libervia
|
||||
|
||||
RUN python3 -m venv libervia_env && libervia_env/bin/pip install -U pip wheel && cd /src && \
|
||||
# We install thoses packages in editable mode, so we can replace them easily with volumes.
|
||||
# We need to move *.egg-info (generated by pip) out of src dirs, otherwise mounting
|
||||
# local repos without it them cause troubles
|
||||
hg clone https://repos.goffi.org/urwid-satext && ~/libervia_env/bin/pip install -e urwid-satext && \
|
||||
mv urwid-satext/urwid_satext.egg-info ~/libervia_env/lib/python3.*/site-packages && \
|
||||
hg clone https://repos.goffi.org/sat_tmp && ~/libervia_env/bin/pip install -e sat_tmp && \
|
||||
mv sat_tmp/sat_tmp.egg-info ~/libervia_env/lib/python3.*/site-packages && \
|
||||
hg clone https://repos.goffi.org/sat_templates && ~/libervia_env/bin/pip install -e sat_templates && \
|
||||
mv sat_templates/sat_templates.egg-info ~/libervia_env/lib/python3.*/site-packages && \
|
||||
hg clone https://repos.goffi.org/sat_media && \
|
||||
hg clone https://repos.goffi.org/sat && ~/libervia_env/bin/pip install -e 'sat[SVG]' && \
|
||||
mv sat/sat.egg-info ~/libervia_env/lib/python3.*/site-packages
|
||||
|
||||
ENV DBUS_SESSION_BUS_ADDRESS=tcp:host=backend,port=55555,family=ipv4
|
||||
ENV PATH=/home/libervia/libervia_env/bin:$PATH
|
||||
|
||||
COPY --chown=root:root libervia.conf /etc/_libervia.conf
|
||||
COPY --chown=libervia:libervia scripts/entrypoint.sh /home/libervia/
|
||||
|
||||
ENTRYPOINT ["/home/libervia/entrypoint.sh"]
|
||||
6
docker/backend-dev/libervia.conf
Normal file
6
docker/backend-dev/libervia.conf
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[DEFAULT]
|
||||
media_dir = /src/sat_media
|
||||
|
||||
[cli]
|
||||
# FIXME: default "auto" value cause trouble
|
||||
background = dark
|
||||
19
docker/backend-dev/scripts/entrypoint.sh
Executable file
19
docker/backend-dev/scripts/entrypoint.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
eval $(dbus-launch --sh-syntax)
|
||||
|
||||
# default, backend is launched in foreground
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
exec libervia-backend fg
|
||||
fi
|
||||
|
||||
# backend is launched with an explicit subcommand
|
||||
if [ $1 = fg -o $1 = bg -o $1 = debug -o $1 = stop -o $1 = status ]
|
||||
then
|
||||
exec libervia-backend "$@"
|
||||
fi
|
||||
|
||||
# a whole command is specified
|
||||
libervia-backend bg
|
||||
exec "$@"
|
||||
Loading…
Reference in a new issue