forked from robertmartin8/PyPortfolioOpt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (20 loc) · 1.02 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM python:3.7.7-slim-stretch as builder
# File Author / Maintainer
# MAINTAINER
# this will be user root regardless whether home/beakerx is not
COPY . /tmp/pypfopt
RUN buildDeps='gcc g++' && \
apt-get update && apt-get install -y $buildDeps --no-install-recommends && \
pip install --no-cache-dir -r /tmp/pypfopt/requirements.txt && \
# One could install the pypfopt library directly in the image. We don't and share via docker-compose instead.
# pip install --no-cache-dir /tmp/pyhrp && \
rm -r /tmp/pypfopt && \
apt-get purge -y --auto-remove $buildDeps
# ----------------------------------------------------------------------------------------------------------------------
FROM builder as test
# COPY tools needed for testing into the image
RUN pip install --no-cache-dir pytest pytest-cov pytest-html
# COPY the tests over
COPY tests /pypfopt/tests
WORKDIR /pypfopt
CMD py.test --cov=pypfopt --cov-report html:artifacts/html-coverage --cov-report term --html=artifacts/html-report/report.html tests