The PyMapManager server allows Map Manager annotations and time-series images to be browsed with a web interface. The server can be run on your local machine using the provided Docker.
For instant satisfaction, we have an experimental server you can use right now.
To run the server locally, you need some data! Example data can be downloaded from the PyMapManager-Data repository. The first thing to do is to clone the PyMapManager and the PyMapManager-Data repositories.
git clone https://github.com/cudmore/PyMapManager.git
git clone https://github.com/mapmanager/PyMapManager-Data.git
This should put both PyMapManager and PyMapManager-Data in the same directory, for example:
/User/me/PyMapManager
/User/me/PyMapManager-Data
Simplest case is to use python mmserver.py
and you should be up in no time. This does have limitations in that the server is run as a single thread/worker. Repeated requests, as occur when scrolling linked images, will cause the server to choke. Don't worry, you won't break anything, it will just be slow. This is why running behind a proper nginx+uwsgi web-sever is way better.
You need a redis-server running. Install it on OSX with brew install redis-server
or on most variants of Linux with sudo apt-get install redis-server
. See redis homepage for more info.
redis-server
cd PyMapManager/app
python mmserver.py
Point your browser to http://localhost:5000
and have fun browsing.
redis-cli shutdown
If you want to run the server inside a Docker container, the easiest option is to use docker-compose
. Using this technique makes a very efficient server and is exactly what we are using to run our production servers.
In docker-compose.yml
, change the path /Users/cudmore/Dropbox/PyMapManager-Data
to the full path to your local copy of PyMapManager-Data
. This little hoop is due to a bug in Docker and will be fixed.
volumes:
- /Users/cudmore/Dropbox/PyMapManager-Data:/PyMapManager-Data
docker-compose build
docker-compose up
Point your browser to http://localhost
and have fun browsing.
docker-compose down
docker-compose run web bash
If you prefer to run the docker services separately and specify paths on the command line.
cd PyMapManager
docker build -t myimage .
docker run -d --name redis -p 6379:6379 redis
You need to change /Users/cudmore/Dropbox/PyMapManager-Data
to point to the full path of your local copy of PyMapManager-Data
. Remember, both PyMapManager
and PyMapManager-Data
need to be in the same folder.
cd PyMapManager
docker run --name mycontainer -p 80:80 -v /Users/cudmore/Dropbox/PyMapManager-Data:/PyMapManager-Data --link redis myimage
Point your browser to http://localhost
and have fun browsing.
docker stop mycontainer
docker rm mycontainer