mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
25 lines
793 B
Docker
25 lines
793 B
Docker
FROM python:3.9-alpine as base
|
|
|
|
MAINTAINER Antoine Nguyen <tonio@ngyn.org>
|
|
ENV VIRTUAL_ENV=/opt/venv
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
FROM base as build
|
|
|
|
RUN apk add --update openssl librrd python3-dev libffi-dev gcc g++ musl-dev libxml2-dev libxslt-dev \
|
|
libressl-dev jpeg-dev rrdtool-dev file make gettext freetype-dev cairo-dev cargo \
|
|
&& rm -rf /var/cache/apk/*
|
|
RUN python3 -m venv $VIRTUAL_ENV
|
|
WORKDIR /tmp
|
|
COPY requirements.txt /tmp
|
|
COPY test-requirements.txt /tmp
|
|
RUN python -m pip install -U pip
|
|
RUN pip install -r requirements.txt -r test-requirements.txt
|
|
|
|
FROM base as run
|
|
COPY --from=build $VIRTUAL_ENV $VIRTUAL_ENV
|
|
RUN apk add --no-cache --update openssl librrd libxslt libjpeg libressl git rrdtool libmagic \
|
|
&& rm -rf /var/cache/apk/*
|
|
RUN mkdir /code
|
|
WORKDIR /code
|