2023-03-17 17:28:07 +03:00
|
|
|
FROM lsiobase/alpine:3.17 as base
|
2021-12-15 17:53:33 +03:00
|
|
|
|
2020-01-21 17:09:52 +03:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2023-03-31 03:44:53 +03:00
|
|
|
|
|
|
|
|
|
|
|
COPY --chown=abc:abc ./requirements.txt ./requirements.txt
|
2022-03-09 23:53:42 +03:00
|
|
|
|
2023-03-17 18:44:16 +03:00
|
|
|
# based on https://github.com/linuxserver/docker-pyload-ng/blob/main/Dockerfile
|
2023-03-31 03:44:53 +03:00
|
|
|
# everything but the app installation is run in one command so we can purge
|
|
|
|
# all build dependencies and cache in the same layer
|
|
|
|
# it may be possible to decrease image size slightly by using build stage and
|
|
|
|
# copying all site-packages to runtime stage but the image is already pretty small
|
2022-03-09 23:53:42 +03:00
|
|
|
RUN \
|
2023-03-31 03:44:53 +03:00
|
|
|
echo "**** install build packages ****" && \
|
2023-03-17 18:44:16 +03:00
|
|
|
apk add --no-cache --virtual=build-deps \
|
2023-03-31 03:44:53 +03:00
|
|
|
gcc \
|
|
|
|
g++ \
|
|
|
|
python3-dev \
|
|
|
|
libxml2-dev \
|
|
|
|
libxslt-dev \
|
|
|
|
libffi-dev \
|
|
|
|
libc-dev \
|
|
|
|
py3-pip \
|
|
|
|
linux-headers && \
|
2023-03-17 18:44:16 +03:00
|
|
|
echo "**** install runtime packages ****" && \
|
|
|
|
apk add --no-cache \
|
2023-03-31 03:44:53 +03:00
|
|
|
python3 \
|
|
|
|
py3-lxml \
|
|
|
|
tzdata && \
|
2023-03-17 18:44:16 +03:00
|
|
|
echo "**** install pip dependencies ****" && \
|
|
|
|
python3 -m ensurepip && \
|
2023-03-31 03:44:53 +03:00
|
|
|
pip3 install -U --no-cache-dir \
|
|
|
|
pip \
|
|
|
|
wheel && \
|
|
|
|
echo "**** install maloja requirements ****" && \
|
|
|
|
pip3 install --no-cache-dir -r requirements.txt && \
|
|
|
|
echo "**** cleanup ****" && \
|
|
|
|
apk del --purge \
|
|
|
|
build-deps && \
|
|
|
|
rm -rf \
|
|
|
|
/tmp/* \
|
|
|
|
${HOME}/.cache
|
|
|
|
|
|
|
|
# actual installation in extra layer so we can cache the stuff above
|
|
|
|
|
|
|
|
COPY --chown=abc:abc . .
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
echo "**** install maloja ****" && \
|
|
|
|
apk add --no-cache --virtual=install-deps \
|
|
|
|
py3-pip && \
|
|
|
|
pip3 install /usr/src/app && \
|
|
|
|
apk del --purge \
|
|
|
|
install-deps && \
|
|
|
|
rm -rf \
|
|
|
|
/tmp/* \
|
|
|
|
${HOME}/.cache
|
|
|
|
|
|
|
|
|
2022-03-09 23:53:42 +03:00
|
|
|
|
2023-03-17 17:28:07 +03:00
|
|
|
COPY container/root/ /
|
|
|
|
|
2023-03-31 03:44:53 +03:00
|
|
|
ENV \
|
|
|
|
# Docker-specific configuration
|
|
|
|
MALOJA_SKIP_SETUP=yes \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
# Prevents breaking change for previous container that ran maloja as root
|
|
|
|
# On linux hosts (non-podman rootless) these variables should be set to the
|
|
|
|
# host user that should own the host folder bound to MALOJA_DATA_DIRECTORY
|
|
|
|
PUID=0 \
|
|
|
|
PGID=0
|
2023-03-17 18:44:16 +03:00
|
|
|
|
2021-12-15 17:53:33 +03:00
|
|
|
EXPOSE 42010
|