| 1 |
FROM debian:bookworm-slim |
| 2 |
|
| 3 |
LABEL maintainer="Goffi <[email protected]>" |
| 4 |
|
| 5 |
ARG REVISION |
| 6 |
ARG DEBIAN_FRONTEND=noninteractive |
| 7 |
|
| 8 |
RUN echo "Building image for Libervia ${REVISION:-dev}" && \ |
| 9 |
apt-get update && apt-get upgrade -y && \ |
| 10 |
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 python3-gpg git && \ |
| 11 |
\ |
| 12 |
# will be used to put many Libervia specific data |
| 13 |
mkdir -p /usr/share/libervia/certificates && \ |
| 14 |
addgroup tls-cert --gid 9999 && \ |
| 15 |
chown :tls-cert /usr/share/libervia/certificates && \ |
| 16 |
chmod 2770 /usr/share/libervia/certificates && \ |
| 17 |
# it's better to have a dedicated user |
| 18 |
useradd -m libervia && adduser libervia tls-cert && \ |
| 19 |
# we'll put all source there to have an easy mount point |
| 20 |
mkdir /src && chown libervia:libervia /src && \ |
| 21 |
\ |
| 22 |
# we need UTF-8 locale |
| 23 |
sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen && locale-gen |
| 24 |
|
| 25 |
ENV LC_ALL en_US.UTF-8 |
| 26 |
ENV DOCKER_LIBERVIA_REV=${REVISION:-dev} |
| 27 |
|
| 28 |
COPY --chown=root:root session.conf /usr/share/dbus-1/session.conf |
| 29 |
|
| 30 |
WORKDIR /home/libervia |
| 31 |
|
| 32 |
RUN apt-get install -y --no-install-recommends libsodium-dev |
| 33 |
USER libervia |
| 34 |
RUN python3 -m venv --system-site-packages libervia_env && libervia_env/bin/pip install -U pip wheel |
| 35 |
|
| 36 |
RUN cd /src && \ |
| 37 |
# We install thoses packages in editable mode, so we can replace them easily with volumes. |
| 38 |
# We need to move *.egg-info (generated by pip) out of src dirs, otherwise mounting |
| 39 |
# local repos without it them cause troubles |
| 40 |
hg clone https://repos.goffi.org/urwid-satext && ~/libervia_env/bin/pip install -e urwid-satext && \ |
| 41 |
hg clone https://repos.goffi.org/sat_tmp -u "${REVISION:-@}" && ~/libervia_env/bin/pip install -e sat_tmp && \ |
| 42 |
hg clone https://repos.goffi.org/libervia-templates && ~/libervia_env/bin/pip install -e libervia-templates && \ |
| 43 |
hg clone https://repos.goffi.org/libervia-media && \ |
| 44 |
hg clone https://repos.goffi.org/libervia-backend -u "${REVISION:-@}" && ~/libervia_env/bin/pip install -e 'libervia-backend[SVG]' && \ |
| 45 |
mkdir -p /home/libervia/.local/share/libervia |
| 46 |
|
| 47 |
ENV DBUS_SESSION_BUS_ADDRESS="tcp:host=backend,port=55555,family=ipv4;unix:path=/home/libervia/.local/share/dbus_socket" |
| 48 |
ENV PATH=/home/libervia/libervia_env/bin:$PATH |
| 49 |
|
| 50 |
COPY --chown=root:root libervia.conf /etc/_libervia.conf |
| 51 |
COPY --chown=libervia:libervia scripts/entrypoint.sh /home/libervia/ |
| 52 |
|
| 53 |
ENTRYPOINT ["/home/libervia/entrypoint.sh"] |