2023-03-17 17:28:07 +03:00
|
|
|
FROM lsiobase/alpine:3.17 as base
|
2022-03-10 09:11:39 +03:00
|
|
|
# Python image includes two Python versions, so use base Alpine
|
2020-01-21 17:09:52 +03:00
|
|
|
|
2021-12-15 17:53:33 +03:00
|
|
|
# Based on the work of Jonathan Boeckel <jonathanboeckel1996@gmail.com>
|
|
|
|
|
2020-01-21 17:09:52 +03:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2022-03-10 09:11:39 +03:00
|
|
|
# Install run dependencies first
|
2022-04-23 21:13:50 +03:00
|
|
|
RUN apk add --no-cache python3 py3-lxml tzdata
|
2022-03-10 09:11:39 +03:00
|
|
|
|
|
|
|
# system pip could be removed after build, but apk then decides to also remove all its
|
|
|
|
# python dependencies, even if they are explicitly installed as python packages
|
|
|
|
# whut
|
|
|
|
RUN \
|
|
|
|
apk add py3-pip && \
|
|
|
|
pip install wheel
|
|
|
|
|
2022-04-08 18:23:56 +03:00
|
|
|
|
2022-03-09 23:53:42 +03:00
|
|
|
COPY ./requirements.txt ./requirements.txt
|
|
|
|
|
|
|
|
RUN \
|
2022-03-10 09:11:39 +03:00
|
|
|
apk add --no-cache --virtual .build-deps gcc g++ python3-dev libxml2-dev libxslt-dev libffi-dev libc-dev py3-pip linux-headers && \
|
|
|
|
pip install --no-cache-dir -r requirements.txt && \
|
2022-03-09 23:53:42 +03:00
|
|
|
apk del .build-deps
|
|
|
|
|
2023-03-17 17:28:07 +03:00
|
|
|
COPY container/root/ /
|
|
|
|
|
2021-12-23 09:48:22 +03:00
|
|
|
|
2022-03-10 09:11:39 +03:00
|
|
|
# no chance for caching below here
|
|
|
|
|
2023-03-17 17:28:07 +03:00
|
|
|
COPY --chown=abc:abc . .
|
2022-03-10 09:11:39 +03:00
|
|
|
|
|
|
|
RUN pip install /usr/src/app
|
2021-12-15 17:53:33 +03:00
|
|
|
|
2022-04-23 21:59:18 +03:00
|
|
|
# Docker-specific configuration
|
|
|
|
# defaulting to IPv4 is no longer necessary (default host is dual stack)
|
2021-12-15 17:53:33 +03:00
|
|
|
ENV MALOJA_SKIP_SETUP=yes
|
2022-04-23 21:59:18 +03:00
|
|
|
ENV PYTHONUNBUFFERED=1
|
2022-04-21 18:46:25 +03:00
|
|
|
|
2021-12-15 17:53:33 +03:00
|
|
|
EXPOSE 42010
|