diff --git a/Dockerfile b/Dockerfile index 570ebfc8786b4ebbf0bc45b66a3858f60a4de8f8..7dabf4b0b49f1aaa4e36f10128596fb699f1bd79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,8 @@ -ARG BUILD_IMAGE=usgs/centos:7 -ARG FROM_IMAGE=usgs/centos:7 -FROM $BUILD_IMAGE AS pycurl-build +ARG FROM_IMAGE=usgs/centos:8 + +FROM $FROM_IMAGE +LABEL maintainer="Jeremy Fee <jmfee@usgs.gov>" -# install conda dependencies -RUN yum install -y \ - bzip2 \ - gcc \ - libcurl-devel \ - && yum clean all # install conda ENV PATH /conda/bin:$PATH @@ -21,29 +16,24 @@ RUN echo 'export PATH=/conda/bin:$PATH' > /etc/profile.d/conda.sh \ # install dependencies via conda RUN conda config --set ssl_verify $SSL_CERT_FILE \ && conda config --add channels conda-forge \ - && conda install --yes jupyter obspy \ - # build pycurl with SFTP support + && conda install --yes jupyter obspy pycurl \ + && conda clean --all -y \ && export PIP_CERT=$SSL_CERT_FILE \ - && export PYCURL_SSL_LIBRARY=nss \ - && pip install pycurl \ - # clean up - && conda clean --all -y - + && pip install \ + authlib \ + flask \ + flask-login \ + flask-migrate \ + flask-session \ + flask-sqlalchemy \ + psycopg2-binary -FROM $FROM_IMAGE -LABEL maintainer="Jeremy Fee <jmfee@usgs.gov>" - -# use conda install from build container -ENV PATH /conda/bin:$PATH -COPY --from=pycurl-build /conda /conda -COPY --from=pycurl-build /etc/profile.d/conda.sh /etc/profile.d/conda.sh # copy library (ignores set in .dockerignore) COPY . /geomag-algorithms -RUN pip install /geomag-algorithms \ - && useradd \ +RUN useradd \ -c 'Docker image user' \ -m \ -r \ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 40d4d80dcc7dcd9569df58959fe01a3709b3b32d..88e66799c41fe657cb05a106b60b99862377b346 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,21 +4,21 @@ # "exec" seems like a much simpler solution for this, # however, jupyter kernels die noisy deaths when using exec. -_term () { - echo 'Caught SIGERM' - kill -TERM "$child" -} -trap _term SIGTERM +# _term () { +# echo 'Caught SIGTERM' +# kill -TERM "$child" +#} +#trap _term SIGTERM # add geomagio to notebook path export PYTHONPATH=/geomag-algorithms # run jupyter notebook server -jupyter notebook \ +exec jupyter notebook \ --ip='*' \ --notebook-dir=/home/geomag_user/notebooks \ --no-browser \ - --port=8000 & + --port=8000 -child=$! -wait "$child" +#child=$! +#wait "$child"