Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize the docker dockering #245

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
30 changes: 30 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -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/'"]

48 changes: 48 additions & 0 deletions docs/source/docker.rst
Original file line number Diff line number Diff line change
@@ -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 <https://docker.com>`_.

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.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
overview
install
tutorial
docker
autoapi/index
cli

Expand Down
Loading