Skip to content

HOWTO Run the server using Docker

Justin Forest edited this page May 15, 2024 · 2 revisions

The recommended way for now is to use Docker. You need to install Docker on your machine, then run the TreeMap app on a specific port like 8002, then configure a CDN, like Cloudflare (which has a free plan) to proxy requests to that server and port.

The image includes a statically compiled frontend, the backend binary, supervisor to run the backend and cron, and a crontab to pull updates from OSM upon every hour. The build file is here.

To start the server, use a script like this:

#!/bin/sh
mkdir -p var
docker run --detach -p 8002:8000 --volume $PWD/var:/app/var --restart unless-stopped --name treemap ghcr.io/umonkey/treemap:latest

To update the image (software version) and restart the server, use a script like this:

#!/bin/sh
IMAGE="ghcr.io/umonkey/treemap:latest"

mkdir -p var
docker pull $IMAGE
docker stop treemap
docker rm treemap
docker run --detach -p 8002:8000 --volume $PWD/var:/app/var --restart unless-stopped --name treemap $IMAGE

This will make the app available at localhost:8002, with the SQLite database stored in ./var. The application can be configured using environment variables, see the configuration page for details.

Note that the app is not yet ready for production, as it lacks user authentication and a lot more.

Clone this wiki locally