maloja/dev/templates/Containerfile.jinja

41 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-03-10 09:00:08 +03:00
FROM alpine:3.15
# Python image includes two Python versions, so use base Alpine
2022-03-09 23:53:42 +03:00
# Based on the work of Jonathan Boeckel <jonathanboeckel1996@gmail.com>
WORKDIR /usr/src/app
2022-03-10 09:00:08 +03:00
# Install run dependencies first
RUN apk add --no-cache {{ tool.osreqs.alpine.run | join(' ') }}
# 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 \
apk add --no-cache --virtual .build-deps {{ tool.osreqs.alpine.build | join(' ') }} && \
2022-03-10 09:00:08 +03:00
pip install --no-cache-dir -r requirements.txt && \
2022-03-09 23:53:42 +03:00
apk del .build-deps
2022-03-10 09:00:08 +03:00
# no chance for caching below here
2022-03-09 23:53:42 +03:00
COPY . .
2022-03-10 09:00:08 +03:00
RUN pip install /usr/src/app
2022-03-09 23:53:42 +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)
2022-03-09 23:53:42 +03:00
ENV MALOJA_SKIP_SETUP=yes
2022-04-23 21:59:18 +03:00
ENV PYTHONUNBUFFERED=1
2022-03-09 23:53:42 +03:00
EXPOSE 42010
# use exec form for better signal handling https://docs.docker.com/engine/reference/builder/#entrypoint
ENTRYPOINT ["maloja", "run"]