-
Notifications
You must be signed in to change notification settings - Fork 984
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
7 changed files
with
41 additions
and
89 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,15 +1,11 @@ | ||
#https://stackoverflow.com/questions/28097064/dockerignore-ignore-everything-except-a-file-and-the-dockerfile | ||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Ignore Everything | ||
** | ||
|
||
!pypfopt | ||
!tests | ||
!setup.py | ||
!README.md | ||
!requirements.txt | ||
!binder | ||
!cookbook | ||
|
||
**/__pycache__ | ||
**/*.pyc | ||
*/__pycache__ | ||
*/*.pyc |
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
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,26 +1,28 @@ | ||
FROM python:3.7.7-slim-stretch as builder | ||
FROM python:3.8-slim-buster | ||
|
||
# this will be user root regardless whether home/beakerx is not | ||
COPY . /tmp/pypfopt | ||
WORKDIR pypfopt | ||
COPY pyproject.toml poetry.lock ./ | ||
|
||
RUN buildDeps='gcc g++' && \ | ||
apt-get update && apt-get install -y $buildDeps --no-install-recommends && \ | ||
pip install --no-cache-dir -r /tmp/pypfopt/requirements.txt && \ | ||
# One could install the pypfopt library directly in the image. We don't and share via docker-compose instead. | ||
# pip install --no-cache-dir /tmp/pyhrp && \ | ||
rm -r /tmp/pypfopt && \ | ||
pip install --upgrade pip==21.0.1 && \ | ||
pip install "poetry==1.1.4" && \ | ||
poetry install -E optionals --no-root && \ | ||
apt-get purge -y --auto-remove $buildDeps | ||
|
||
|
||
# ---------------------------------------------------------------------------------------------------------------------- | ||
FROM builder as test | ||
|
||
# COPY tools needed for testing into the image | ||
RUN pip install --no-cache-dir pytest pytest-cov pytest-html | ||
|
||
# COPY the tests over | ||
COPY tests /pypfopt/tests | ||
|
||
WORKDIR /pypfopt | ||
|
||
CMD py.test --cov=pypfopt --cov-report html:artifacts/html-coverage --cov-report term --html=artifacts/html-report/report.html tests | ||
COPY . . | ||
|
||
# Usage examples: | ||
# | ||
# Build | ||
# docker build . -t pypfopt | ||
# | ||
# Run | ||
# iPython interpreter: | ||
# docker run -it pypfopt poetry run ipython | ||
# Jupyter notebook server: | ||
# docker run -it -p 8888:8888 pypfopt poetry run jupyter notebook --allow-root --no-browser --ip 0.0.0.0 | ||
# Pytest | ||
# docker run -t pypfopt poetry run pytest | ||
# Bash | ||
# docker run -it pypfopt bash |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.