Skip to content

Commit 7ffd1b0

Browse files
committed
minimal setup
1 parent babfc17 commit 7ffd1b0

File tree

7 files changed

+41
-89
lines changed

7 files changed

+41
-89
lines changed

.dockerignore

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
#https://stackoverflow.com/questions/28097064/dockerignore-ignore-everything-except-a-file-and-the-dockerfile
1+
# Environments
2+
.env
3+
.venv
4+
env/
5+
venv/
6+
ENV/
7+
env.bak/
8+
venv.bak/
29

3-
# Ignore Everything
4-
**
5-
6-
!pypfopt
7-
!tests
8-
!setup.py
9-
!README.md
10-
!requirements.txt
11-
!binder
12-
!cookbook
13-
14-
**/__pycache__
15-
**/*.pyc
10+
*/__pycache__
11+
*/*.pyc

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ DEV/
1111
.pytest_cache/
1212
.vscode/
1313

14+
# Environments
15+
.env
16+
.venv
17+
env/
18+
venv/
19+
ENV/
20+
env.bak/
21+
venv.bak/
22+
1423
pip-selfcheck.json
1524

1625
html-coverage

Dockerfile

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
FROM python:3.7.7-slim-stretch as builder
1+
FROM python:3.8-slim-buster
22

3-
# this will be user root regardless whether home/beakerx is not
4-
COPY . /tmp/pypfopt
3+
WORKDIR pypfopt
4+
COPY pyproject.toml poetry.lock ./
55

66
RUN buildDeps='gcc g++' && \
77
apt-get update && apt-get install -y $buildDeps --no-install-recommends && \
8-
pip install --no-cache-dir -r /tmp/pypfopt/requirements.txt && \
9-
# One could install the pypfopt library directly in the image. We don't and share via docker-compose instead.
10-
# pip install --no-cache-dir /tmp/pyhrp && \
11-
rm -r /tmp/pypfopt && \
8+
pip install --upgrade pip==21.0.1 && \
9+
pip install "poetry==1.1.4" && \
10+
poetry install -E optionals --no-root && \
1211
apt-get purge -y --auto-remove $buildDeps
1312

14-
15-
# ----------------------------------------------------------------------------------------------------------------------
16-
FROM builder as test
17-
18-
# COPY tools needed for testing into the image
19-
RUN pip install --no-cache-dir pytest pytest-cov pytest-html
20-
21-
# COPY the tests over
22-
COPY tests /pypfopt/tests
23-
24-
WORKDIR /pypfopt
25-
26-
CMD py.test --cov=pypfopt --cov-report html:artifacts/html-coverage --cov-report term --html=artifacts/html-report/report.html tests
13+
COPY . .
14+
15+
# Usage examples:
16+
#
17+
# Build
18+
# docker build . -t pypfopt
19+
#
20+
# Run
21+
# iPython interpreter:
22+
# docker run -it pypfopt poetry run ipython
23+
# Jupyter notebook server:
24+
# docker run -it -p 8888:8888 pypfopt poetry run jupyter notebook --allow-root --no-browser --ip 0.0.0.0
25+
# Pytest
26+
# docker run -t pypfopt poetry run pytest
27+
# Bash
28+
# docker run -it pypfopt bash

binder/Dockerfile

Lines changed: 0 additions & 20 deletions
This file was deleted.

binder/jupyter_notebook_config.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

docker-compose.test.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

docker-compose.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)