diff --git a/Dockerfile b/Dockerfile index f719ae83b..8926eb004 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM openmicroscopy/omero-web-standalone:latest +FROM openmicroscopy/omero-web-standalone:5.21.0 USER root RUN yum -y install npm diff --git a/README.rst b/README.rst index 12d4ae2ab..1be748f9a 100644 --- a/README.rst +++ b/README.rst @@ -163,27 +163,59 @@ with: $ grunt watch -It is also possible to develop figure in docker without installing anything locally. -The Docker image is built on top of ``openmicroscopy/omero-web-standalone:latest``, so you will have a fully functional -omero-web environment while developing ``omero-figure``. -First build the Docker image: + +Local install +************* + +You need an `omero-web` environment. You can either install it locally or use Docker (see below). +To install locally, we recommend that you use `conda` to install `omero-py` as described +at https://github.com/ome/omero-py and then perform a developer install of `omero-figure` +which will include `omero-web`: + +:: + + $ cd omero-figure + $ pip install -e . + +You'll also need to run the `omero config` steps detailed above. +See instructions at https://omero.readthedocs.io/en/latest/developers/Web/Deployment.html +for running the development server. + +Using Docker +************ + +It is also possible to develop figure in docker without creating a python environment locally. +The Docker image at ``omero-figure/Dockerfile`` is built on top of +`openmicroscopy/omero-web-standalone:latest `_, +so you will have a fully functional omero-web environment while developing ``omero-figure``. +This Docker image includes OMERO.figure. You can either replace this with a link to your local ``omero-figure`` repo +or you can use the Docker copy of OMERO.figure for development. + +In either case, start by building the Docker image and specify the server you wish to connect to: :: + $ cd omero-figure $ docker build -t figure-devel . + $ export OMEROHOST=demo.openmicroscopy.org +To use your local ``omero-figure`` repo for development, you can mount this in place of the Docker ``omero-figure``. +You'll need `npm` and `grunt` installed locally and run `grunt watch` during development as described above. +You can refresh the Docker hosted page at http://localhost:4080/figure to see changes: -To develop ``omero-figure`` you can either make all the changes within the Docker container itself by running: :: + $ docker run -ti -e OMEROHOST -p 4080:4080 -v /PATH_TO_GIT_REPO/omero-figure:/home/figure/src figure-devel - $ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 figure-devel + # in a different terminal, run grunt build or watch... + $ cd /PATH_TO_GIT_REPO/omero-figure + $ grunt build # or grunt watch -The preferred option is to mount the repository containing the omero-figure code. Make the changes locally and see the changes in the docker container. To do so, run: +Alternatively, to run and develop ``omero-figure`` within the Docker container itself: :: - $ docker run -ti -e OMEROHOST=YOUR_HOST -p 4080:4080 -v /PATH_TO_GIT_REPO/omero-figure:/home/figure/src figure-devel + $ docker run -ti -e OMEROHOST -p 4080:4080 figure-devel After starting the container, run ``docker ps`` in another terminal to find the ID of the container. Then run: @@ -191,7 +223,8 @@ After starting the container, run ``docker ps`` in another terminal to find the $ docker exec -u 0 -it CONTAINER_ID bash # replace CONTAINER_ID by the correct value $ cd /home/figure/src - $ grunt watch + $ vi src/js/app.js + $ grunt build # or run grunt watch in another terminal