From f50834d4acdd09a29d7a30cb3f00fe19c86c214e Mon Sep 17 00:00:00 2001 From: Marwan Zouinkhi Date: Thu, 18 Apr 2024 15:32:20 -0400 Subject: [PATCH] dockerfile --- CONTRIBUTING.md | 8 +++++++ dockerfile | 30 ++++++++++++++++++++++++++ docs/source/docker.rst | 48 ++++++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 1 + 4 files changed, 87 insertions(+) create mode 100644 dockerfile create mode 100644 docs/source/docker.rst diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5604ad317..892c7333a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,3 +26,11 @@ This will also be run automatically when a PR is made to master and a codecov re - For a completely new feature, make a branch off of the `dev/main` branch of CellMap's fork of DaCapo with a name describing the feature. If you are collaborating on a feature that already has a branch, you can branch off that feature branch. - Currently, you should make your PRs into the `dev/main` branch of CellMap's fork, or the feature branch you branched off of. PRs currently require one maintainer's approval before merging. Once the PR is merged, the feature branch should be deleted. - `dev/main` will be regularly merged to `main` when new features are fully implemented and all tests are passing. + + +## Documentation +Documentation is built using Sphinx. To build the documentation locally, run +```bash +sphinx-build -M html docs/source docs/build +``` +This will generate the html files in the `docs/build/html` directory. \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 000000000..b766d30c3 --- /dev/null +++ b/dockerfile @@ -0,0 +1,30 @@ +FROM python:3.11-slim + +WORKDIR /app + +RUN apt-get update && apt-get install -y \ + gcc \ + g++ \ + pkg-config \ + make \ + libhdf5-dev \ + libc-dev \ + npm \ + git \ + && rm -rf /var/lib/apt/lists/* + +RUN npm install -g configurable-http-proxy + +RUN pip install --upgrade pip + +RUN pip install h5py +RUN pip install dacapo-ml +RUN pip install notebook + +RUN git clone https://github.com/janelia-cellmap/dacapo.git +RUN mv dacapo/examples examples && rm -rf dacapo + +EXPOSE 8000 + +CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8000", "--NotebookApp.allow_origin='*'", "--allow-root", "--NotebookApp.token=''", "--NotebookApp.password=''", "--NotebookApp.notebook_dir='/app/'"] + diff --git a/docs/source/docker.rst b/docs/source/docker.rst new file mode 100644 index 000000000..7782c350f --- /dev/null +++ b/docs/source/docker.rst @@ -0,0 +1,48 @@ +.. automodule:: dacapo + +.. contents:: + :depth: 1 + :local: + +Docker Configuration for JupyterHub-Dacapo +========================================= + +This document provides instructions on how to build and run the Docker image for the JupyterHub-Dacapo project. + +Requirements +------------ +Before you begin, ensure you have Docker installed on your system. You can download it from `Docker's official website `_. + +Building the Docker Image +------------------------- +To build the Docker image, navigate to the directory containing your Dockerfile and run the following command: + +.. code-block:: bash + + docker build -t jupyterhub-dacapo . + +This command builds a Docker image with the tag `jupyterhub-dacapo` using the Dockerfile in the current directory. + +Running the Docker Container +---------------------------- +Once the image is built, you can run a container from the image with the following command: + +.. code-block:: bash + + docker run -p 8000:8000 jupyterhub-dacapo + +This command starts a container based on the `jupyterhub-dacapo` image. It maps port 8000 of the container to port 8000 on the host, allowing you to access JupyterHub by navigating to `http://localhost:8000` in your web browser. + +Stopping the Docker Container +----------------------------- +To stop the running container, you can use the Docker CLI to stop the container: + +.. code-block:: bash + + docker stop [CONTAINER_ID] + +Replace `[CONTAINER_ID]` with the actual ID of your running container. You can find the container ID by listing all running containers with `docker ps`. + +Further Configuration +--------------------- +For additional configuration options, such as setting environment variables or configuring volumes, refer to the Docker documentation or the specific documentation for the JupyterHub or Dacapo configurations. diff --git a/docs/source/index.rst b/docs/source/index.rst index 703084605..a4390edd3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,6 +10,7 @@ overview install tutorial + docker autoapi/index cli