From 4b2ab1d6799278c496f252e183f08d593a78e5cc Mon Sep 17 00:00:00 2001 From: TomatenMarc Date: Tue, 2 Oct 2018 21:11:47 +0200 Subject: [PATCH 1/3] Add Dockerfile --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f03e62a2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.6 + +RUN apt-get update -yqq &&\ + apt-get upgrade -yqq &&\ + apt-get install gcc libenchant1c2a -yqq --fix-missing + +COPY . /surprise +WORKDIR surprise + +RUN pip install -Uq pip &&\ + pip --quiet install -r requirements_dev.txt && \ + pip --quiet install scikit-surprise + +RUN ["python", "setup.py", "install"] From 75bb97959d815a44d3ee3abbd12e6ef1d03bd571 Mon Sep 17 00:00:00 2001 From: feger Date: Wed, 3 Oct 2018 22:59:46 +0200 Subject: [PATCH 2/3] Add Documentation for Docker --- Dockerfile | 3 ++- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f03e62a2..fd962cbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ WORKDIR surprise RUN pip install -Uq pip &&\ pip --quiet install -r requirements_dev.txt && \ - pip --quiet install scikit-surprise + pip --quiet install scikit-surprise && \ + pip install -e . RUN ["python", "setup.py", "install"] diff --git a/README.md b/README.md index b459a002..fb1c5b8d 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,47 @@ For the latest version, you can also clone the repo and build the source $ git clone https://github.com/NicolasHug/surprise.git $ cd surprise $ python setup.py install + +Docker +------ +With [Docker](https://www.docker.com) it is possible to run a development environment on your local machine. +This is similar to a so called [Virtual Machine](https://www.virtualbox.org/) or [Virtual Environment](https://virtualenv.pypa.io/en/stable/). + +You can download [Docker](https://www.docker.com) for any OS [here](https://www.docker.com/get-started). + +If you have [Docker](https://www.docker.com) installed you are ready to go. + +To create a image of surprise simply navigate to the directory where this project is stored and enter it. +This should look like this:: + + /Surprise + -> /doc + -> /example + -> /surprise + -> /tests + -> Dockerfile + -> ... + +To create a image of Surprise run:: + + $ docker build -t surprise . + +This will create a image named surprise which can be used for development. + +To run a container use:: + + $ docker run -it -v "$PWD":/surprise surprise bash + +This will start a container and mounts every change in the project to it. + +You can then run every command inside the container or use the Dockerfile as a [interpreter](https://blog.jetbrains.com/pycharm/2015/12/using-docker-in-pycharm/) +for PyCharm. + +Or you can simply run a test-container for testing your project by running:: + + $ docker run surprise pytest + +Or simply run any other command you wish. License ------- From 432a0084be96550dd7d3d1e502ef5a527cf6dd00 Mon Sep 17 00:00:00 2001 From: feger Date: Wed, 3 Oct 2018 23:02:31 +0200 Subject: [PATCH 3/3] Add Maintainer to Dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index fd962cbe..14e3dacc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ FROM python:3.6 +MAINTAINER Marc Feger RUN apt-get update -yqq &&\ apt-get upgrade -yqq &&\