This repository has been archived by the owner on Mar 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
65 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,69 @@ | ||
FROM python:3.5 | ||
USER root | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
libxml2-dev \ | ||
libxslt1-dev \ | ||
python3-dev \ | ||
unzip \ | ||
zlib1g-dev | ||
|
||
RUN pip install --upgrade pip | ||
FROM python:3.5-alpine | ||
|
||
WORKDIR /home | ||
|
||
COPY requirements.txt ./ | ||
COPY setup ./ | ||
RUN ./setup | ||
COPY rosie.py ./ | ||
|
||
ADD http://www.netlib.org/blas/blas-3.5.0.tgz /tmp/blas.tgz | ||
ADD http://www.netlib.org/lapack/lapack-3.5.0.tgz /tmp/lapack.tgz | ||
|
||
# install basic build dependencies | ||
RUN apk update && apk upgrade && apk add --no-cache --virtual=build_dependencies \ | ||
cmake \ | ||
g++ \ | ||
gcc \ | ||
gfortran \ | ||
git \ | ||
libffi \ | ||
libxml2 \ | ||
libxml2-dev \ | ||
libxslt \ | ||
libxslt-dev \ | ||
make \ | ||
musl-dev && \ | ||
|
||
# fix numpy installing error | ||
ln -s /usr/include/locale.h /usr/include/xlocale.h && \ | ||
|
||
# compile BLAS (scipy dependency) | ||
mkdir -p ~/src/ && \ | ||
cd ~/src/ && \ | ||
mv /tmp/blas.tgz . && \ | ||
tar xzf blas.tgz && \ | ||
cd BLAS-3.5.0 && \ | ||
gfortran -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c *.f && \ | ||
ar r libfblas.a *.o && \ | ||
ranlib libfblas.a && \ | ||
rm -rf *.o && \ | ||
|
||
# compile LAPACK (scipy dependency) | ||
mkdir -p ~/src/ && \ | ||
cd ~/src/ && \ | ||
mv /tmp/lapack.tgz . && \ | ||
tar xzf lapack.tgz && \ | ||
cd lapack-3.5.0/ && \ | ||
cp make.inc.example make.inc && \ | ||
sed -i -- 's/frecursive/fPIC/g' make.inc && \ | ||
make lapacklib -j$(cat /proc/cpuinfo | grep 'processor' | wc -l) && \ | ||
make clean && \ | ||
cd /home && \ | ||
|
||
pip install numpy && \ | ||
|
||
BLAS=~/src/BLAS-3.5.0/libfblas.a LAPACK=~/src/lapack-3.5.0/liblapack.a pip install scipy==0.19.0 && \ | ||
|
||
pip install -r requirements.txt && \ | ||
|
||
# cleanup | ||
apk del build_dependencies && \ | ||
apk add --no-cache libstdc++ libgfortran libxslt && \ | ||
rm -rf /var/cache/apk/* && \ | ||
rm -rf ~/src | ||
|
||
|
||
COPY rosie ./rosie | ||
COPY rosie.py config.ini ./ | ||
|
||
VOLUME /tmp/serenata-data | ||
|
||
CMD python rosie.py run |