153 lines
4.8 KiB
Docker
153 lines
4.8 KiB
Docker
FROM docker.mimirdb.info/alpine_oraclejdk8
|
|
|
|
# Metadata
|
|
LABEL base.image="docker.mimirdb.info/alpine_oraclejdk8"
|
|
LABEL version="0.2"
|
|
LABEL software="Vizier"
|
|
LABEL software.version="0.2.20190306"
|
|
LABEL description="an open source, provenance aware, iterative data cleaning tool"
|
|
LABEL website="http://vizierdb.info"
|
|
LABEL sourcecode="https://github.com/VizierDB"
|
|
LABEL documentation="https://github.com/VizierDB/web-api/wiki"
|
|
LABEL tags="CSV,Data Cleaning,Databases,Provenance,Workflow,Machine Learning"
|
|
|
|
ARG gituser
|
|
ARG gitpass
|
|
ARG API_BRANCH=master
|
|
|
|
ENV API_SCHEME=http
|
|
ENV API_SERVER=localhost
|
|
ENV API_SERVER_USE_PUB_IP=false
|
|
ENV API_PORT=5000
|
|
ENV API_LOCAL_PORT=5000
|
|
ENV PROFILER=0
|
|
ENV MIMIR_HOST="vizier-mimir.local"
|
|
ENV RUN_SSH=true
|
|
ENV ACME_HOSTS="api.vizier.app"
|
|
ENV GLIBC_VERSION 2.27-r0
|
|
|
|
EXPOSE 9001
|
|
EXPOSE 443
|
|
EXPOSE 22
|
|
|
|
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
|
&& apk add --update \
|
|
build-base alpine-sdk \
|
|
fuse fuse-dev \
|
|
automake autoconf \
|
|
libressl-dev \
|
|
curl-dev \
|
|
ca-certificates \
|
|
musl \
|
|
gcc \
|
|
libc-dev \
|
|
bash \
|
|
git \
|
|
python \
|
|
python-dev \
|
|
py-pip \
|
|
gfortran \
|
|
lapack-dev \
|
|
libxml2-dev \
|
|
libxslt-dev \
|
|
jpeg-dev \
|
|
libxext \
|
|
libsm \
|
|
libxrender \
|
|
curl \
|
|
sed \
|
|
openssh \
|
|
supervisor \
|
|
&& pip install --upgrade pip \
|
|
&& rm /var/cache/apk/* \
|
|
&& mkdir /usr/local/source
|
|
|
|
RUN apk add geos py-geos geos-dev \
|
|
--update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
|
|
|
|
#setup ssh
|
|
RUN echo 'root:odinlab' |chpasswd
|
|
RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
|
|
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
|
|
&& ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa \
|
|
&& ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa \
|
|
&& ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa \
|
|
&& ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
|
|
|
|
ENV IAM_ROLE=none
|
|
ENV AWS_ACCESS_KEY_ID=value
|
|
ENV AWS_SECRET_ACCESS_KEY=value
|
|
ENV USE_S3_VOLUME=true
|
|
ENV S3_ENDPOINT=
|
|
ENV S3_BUCKET_ACL=private
|
|
ENV S3_BUCKET_NAME=none
|
|
ENV MOUNT_POINT=/usr/local/source/web-api/.vizierdb
|
|
|
|
ARG S3FS_VERSION=v1.82
|
|
|
|
RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && \
|
|
cd s3fs-fuse \
|
|
git checkout tags/${S3FS_VERSION} && \
|
|
./autogen.sh && \
|
|
./configure --prefix=/usr && \
|
|
make && \
|
|
make install
|
|
|
|
RUN s3fs --version
|
|
|
|
#install python 2.7
|
|
RUN echo "manylinux1_compatible = True" > /usr/lib/python2.7/_manylinux.py \
|
|
&& cd /usr/bin \
|
|
&& ln -sf easy_install-2.7 easy_install \
|
|
&& ln -sf python2.7 python \
|
|
&& ln -sf python2.7-config python-config \
|
|
&& ln -sf pip2.7 pip \
|
|
&& ln -sf /usr/include/locale.h /usr/include/xlocale.h
|
|
|
|
#install anaconda
|
|
#RUN curl -OsL "https://repo.continuum.io/archive/Anaconda2-5.1.0-Linux-x86_64.sh" \
|
|
# && /bin/bash Anaconda2-5.1.0-Linux-x86_64.sh -b -p /opt/conda \
|
|
# && rm Anaconda2-5.1.0-Linux-x86_64.sh \
|
|
# && echo 'export PATH=/opt/conda/bin:$PATH' >> /etc/profile.d/conda.sh
|
|
|
|
#install miniconda
|
|
RUN curl -OsL "https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh" \
|
|
&& /bin/bash Miniconda2-latest-Linux-x86_64.sh -b -p /opt/conda \
|
|
&& rm Miniconda2-latest-Linux-x86_64.sh \
|
|
&& echo 'export PATH=/opt/conda/bin:$PATH' >> /etc/profile.d/conda.sh
|
|
|
|
|
|
#setup web-api
|
|
#copy local archive instead of pulling from github
|
|
#COPY web-api.tgz /usr/local/source/
|
|
#RUN tar -C /usr/local/source/ -zxvf /usr/local/source/web-api.tgz \
|
|
RUN cd /usr/local/source/ \
|
|
&& git clone https://$gituser:$gitpass@github.com/VizierDB/web-api.git \
|
|
&& cd /usr/local/source/web-api \
|
|
&& git checkout -b local_$API_BRANCH origin/$API_BRANCH \
|
|
&& sed -i 's/libiconv=1.15=0/libiconv=1.15/g' environment.yml \
|
|
&& /opt/conda/bin/conda env create -f environment.yml \
|
|
&& source /opt/conda/bin/activate vizier \
|
|
&& pip install git+https://$gituser:$gitpass@github.com/VizierDB/Vistrails.git \
|
|
&& pip install gunicorn \
|
|
&& pip install futures \
|
|
&& pip install matplotlib \
|
|
&& pip install https://github.com/matplotlib/basemap/archive/v1.1.0.tar.gz \
|
|
&& pip install -e . \
|
|
&& mkdir -p /usr/local/source/web-api/.vizierdb
|
|
|
|
ENV APP_PATH="/vizier-db/api/v1"
|
|
|
|
COPY rewrite_configs.sh /usr/local/source/rewrite_configs.sh
|
|
COPY run_init.sh /usr/local/source/run_init.sh
|
|
COPY run_web_api.sh /usr/local/source/run_web_api.sh
|
|
COPY entrypoint.sh /usr/local/source/entrypoint.sh
|
|
COPY supervisord.conf /etc/supervisord.conf
|
|
|
|
RUN chmod +x /usr/local/source/rewrite_configs.sh \
|
|
/usr/local/source/run_init.sh \
|
|
/usr/local/source/run_web_api.sh \
|
|
/usr/local/source/entrypoint.sh
|
|
|
|
ENTRYPOINT ["\/bin\/bash", "-c", "/usr/local/source/entrypoint.sh"]
|