Dockerfile 1.31 KiB
# datafetcher Dockerfile
#
# TO BUILD the docker image: -don't- "docker build" directly!
# use docker_build.sh:
# from apps/cli/executables/datafetcher,
#
# ./docker_build.sh datafetcher_test[:N]
#
# where '-t' specifies a name and N' is the version.
# (If ':N' is omitted, version is 'latest' by default.)
# tag is not required for the build, but without it
#the container name is an unhelpful hexadecimal value.
FROM continuumio/miniconda3:latest
# get what we'll need for the build
COPY . .
# get application files and tests
COPY src/ .
COPY test/ .
# TODO: figure out a way to genericize this;
# may need to have docker_build.sh write this Dockerfile
# so it can update the PATH dynamically
# ENV PATH /Users/jgoldste/miniconda3/bin/conda:$PATH
ENV PATH $HOME/miniconda3/bin/conda:$PATH
# docker_build.sh should have copied environment.yml from data/;
# it will be used in the command below
RUN conda env update
# environment.yml has name "data"
RUN [ "conda", "activate", "data" ]
# install the application
RUN python setup.py develop
# we'll need a Capo profile
ENV CAPO_PROFILE local
ENV CAPO_PATH test/
# do NOT run as root
USER 503
# finally, run the tests. be verbose. log stuff.
# (for more detailed output, use "-vv" and/or "--log-level=DEBUG")
ENTRYPOINT [ "pytest", "-v", "--log-level=INFO", "datafetcher_test.py" ]