From e32d5c0421b8f3a31882d25c3332905a43fc18be Mon Sep 17 00:00:00 2001
From: Lisanne Nauta <lisanne.nauta@wur.nl>
Date: Thu, 14 Dec 2023 15:31:39 +0100
Subject: [PATCH] General updates

---
 .dockerignore       |  4 +++-
 .gitignore          |  3 ++-
 .gitlab-ci.yml      |  1 -
 Dockerfile          |  2 +-
 README.md           | 43 ++++++++++++++++++++++++++++++++++---------
 docker-compose.yaml | 16 ++++++++++++++++
 6 files changed, 56 insertions(+), 13 deletions(-)
 create mode 100644 docker-compose.yaml

diff --git a/.dockerignore b/.dockerignore
index ae1b890..1fc6ea9 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,5 +1,7 @@
 .gitlab-ci.yml
+.gitignore
 Dockerfile
+.dockerignore
 isimip3b
 isimip3b.zip
-builds
\ No newline at end of file
+.ipynb_checkpoints
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 3ee5830..8e65331 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 isimip3b.zip
 isimip3b
-builds
\ No newline at end of file
+builds
+.ipynb_checkpoints
\ No newline at end of file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 538ce1c..70748e9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -49,7 +49,6 @@ docker-build:
     - if: 
       changes:
         - ".gitignore"
-        - ".dockerignore"
       when: never
 
 
diff --git a/Dockerfile b/Dockerfile
index a286bfd..0c7f8d8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,4 +3,4 @@ FROM jupyter/datascience-notebook:ubuntu-22.04
 RUN wget -O isimip3b.zip https://zenodo.org/api/records/10256871/files/isimip3b.zip/content 
 RUN unzip isimip3b.zip && rm isimip3b.zip
 
-COPY . $HOME
\ No newline at end of file
+COPY ./exercises ./work
\ No newline at end of file
diff --git a/README.md b/README.md
index 5a0bbf1..e2f0c9d 100644
--- a/README.md
+++ b/README.md
@@ -1,28 +1,53 @@
 # ML notebooks
 
-## Description
-
+[[_TOC_]]
 
 ## Installation
 
+**Requirements**
+-docker
+-git (optional)
+
+Install the [Docker Engine](https://docs.docker.com/engine/install/).
 
-## Usage
+Choose between:
+- [Build Docker Image](#build-docker-image) (prefered)
+- [Using the container registry](#using-the-container-registry)
 
+### Build Docker Image
 
-## Support
+Clone the repository.
 
+```bash
+git clone https://git.wur.nl/nauta008/ml-notebooks
+```
 
-## Roadmap
+Run `cd ml-notebooks` to navigate to the root of the project. Build the image and run the container.
 
+```bash
+docker compose up
+```
 
-## Contributing
+Open a browser and navigate to <localhost:8888>. Work on your exercises and when you are finished run:
 
+```bash
+docker compose down
+```
 
-## Authors and acknowledgment
+### Using the container registry
+Download the docker image for an amd64 architecture.
 
+```bash
+docker pull docker-registry.wur.nl/nauta008/ml-notebooks:latest
+```
 
-## License
+Run the following command to start Jupyter Lab. We mounted a volume into the `work` folder to store your progress. Keep in mind that your progress is only stored in this `work` folder.
 
+```bash
+docker run -p 8888:8888 --name ml-notebooks -v ml-notebooks:/home/jovyan/work docker-registry.wur.nl/nauta008/ml-notebooks start.sh jupyter lab --NotebookApp.token=''
+```
+Open a browser and navigate to <localhost:8888>
 
-## Project status
+## Data
+<https://zenodo.org/records/10256871>
 
diff --git a/docker-compose.yaml b/docker-compose.yaml
new file mode 100644
index 0000000..db347cb
--- /dev/null
+++ b/docker-compose.yaml
@@ -0,0 +1,16 @@
+# volumes:
+#   content:
+services:
+  server:
+    build: .
+    # user: root
+    ports:
+      - 8888:8888
+    environment:
+      CHOWN_HOME: 'yes'
+      CHOWN_HOME_OPTS: '-R'
+    entrypoint: sh -c "jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --NotebookApp.token=''"
+    volumes:
+      - ${PWD}/exercises:/home/jovyan/work
+    # volumes:
+    #   - content:/home/jovyan/exercises
\ No newline at end of file
-- 
GitLab