diff --git a/Dockerfile b/Dockerfile index 8123199333a12ca68d66bce1657c4eea75064dfc..523a940d85d2ce95b8b2dc3f8166a791b718a3e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,14 @@ ARG FROM_IMAGE=usgs/centos:8 FROM ${FROM_IMAGE} LABEL maintainer="Jeremy Fee <jmfee@usgs.gov>" -# install conda +# set environment variables ENV PATH /conda/bin:$PATH ENV LC_ALL='en_US.UTF-8' ENV LANG='en_US.UTF-8' ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 +# install conda RUN echo 'export PATH=/conda/bin:$PATH' > /etc/profile.d/conda.sh \ && curl \ https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 008ff9a30340c3781870ad3f8bbba1889553deef..d4287ae6d74a1b007b645b81d7684387198bd815 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,6 +1,7 @@ #! /bin/bash # Environment variable to determine whether to start webservice export WEBSERVICE=${WEBSERVICE:-false} + # add geomagio to notebook path export PYTHONPATH=/geomag-algorithms @@ -14,5 +15,6 @@ if [ $WEBSERVICE = 'false' ]; then --port=8000 else +# run gunicorn server for web service exec pipenv run gunicorn --bind 0.0.0.0:8000 -w 4 -k uvicorn.workers.UvicornWorker geomagio.api.app:app fi