Dockerfile 1.93 KB
Newer Older
1
FROM debian:bullseye-slim AS lava-build
2
3
4
5
6
7
8
9
10
11
12
13
14
15

ENV DEBIAN_FRONTEND noninteractive

COPY . /lava

RUN apt update && apt install -y --no-install-recommends devscripts dpkg-dev xz-utils && \
    cd /lava && \
    export LAVA_VERSION=$(dpkg-parsechangelog -S Version | cut -d '-' -f 1) && \
    tar --xform "s,^\.,lava-${LAVA_VERSION}," -Jcpf ../lava_${LAVA_VERSION}.orig.tar.xz . && \
    apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes build-dep . && \
    debuild --no-sign

FROM debian:bullseye-slim AS server

16
COPY --from=lava-build /lava-server*.deb /lava-common*.deb /
17
18
19
20
21
22
23
24
25
COPY docker/collabora/start-lava.sh /

# LAVA won't like not finding some variables when it imports its configuration.
# We only set up the actual configuration when starting the container, but provide
# "blank" ones to make installation happy.
ARG INSTANCE_NAME=default
ARG DATABASE_URL=sqlite://:memory:
ARG SECRET_KEY=secret

26
27
28
29
30
# Our base image disallows installation of most documentation files,
# override that lava-server-doc, as the files are used to provide the
# live documentation.
COPY docker/collabora/lava-dpkg.cfg /etc/dpkg/dpkg.cfg.d/lava

31
32
33
RUN apt update && \
    apt install -y --no-install-recommends \
        /*.deb \
34
35
36
37
38
        wait-for-it \
        python3-pip \
        python3-requests \
        python3-josepy \
        python3-cryptography && \
39
    rm /*deb
40
RUN pip3 install --no-deps mozilla-django-oidc=="2.0.0"
41

42
43
44
# Logging env
COPY docker/collabora/logging_env.yaml /

45
46
47
48
49
50
51
52
53
54
55
56
57
# We use configuration from the environment, not an env file, but we need this empty file
# to silence a warning from django-environ.
RUN touch /usr/lib/python3/dist-packages/lava_server/settings/.env

# This is lava-server's port. Hitting it hits gunicorn and Django.
# This port is the one you'll want ProxyPass to, mainly.
EXPOSE 8000

# This port is opened by lava-publisher. It provides the web socket
# server that the worker connects to on the /ws/ path.
EXPOSE 8001

CMD "/start-lava.sh"