Skip to content

Installation

Justin Forest edited this page Apr 26, 2024 · 9 revisions

Table of Contents:

Running with Docker

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.

Running a development setup

For development, you need to install Rust and Node on your machine, then run backend and frontend separately.

To run the backend, use this command:

$ make -C backend serve

To run the front end, use this command:

$ make -C frontend serve
Clone this wiki locally