mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
* add missing dependencies to be able to use docker without these dependencies, the `docker-compose up` command is failing - `rrdtool-dev` and `librrd` when building `rrdtool-0.1.15.tar.gz` - `make` and `file` when building `gevent-1.5.0.tar.gz` * disable secure cookies for being able to login when docker is used with runserver (there is no ssl) * run develop command to avoid a hard failure after login when using the docker image (version check is performed but pkg_resources is not able to find modoboa distribution) * polish multi stage docker build (adding missing dependencies for pip install and when running the application); use a virtual environment which is shared between the stages by using a base image and others will extend this
24 lines
702 B
Docker
24 lines
702 B
Docker
FROM python:3.6-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 musl-dev libxml2-dev libxslt-dev \
|
|
libressl-dev jpeg-dev rrdtool-dev file make \
|
|
&& rm -rf /var/cache/apk/*
|
|
RUN python3 -m venv $VIRTUAL_ENV
|
|
WORKDIR /tmp
|
|
COPY requirements.txt /tmp
|
|
COPY test-requirements.txt /tmp
|
|
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 librrd libxslt libjpeg libressl git rrdtool \
|
|
&& rm -rf /var/cache/apk/*
|
|
RUN mkdir /code
|
|
WORKDIR /code
|