Using Docker Compose
With Docker Compose you can download and run GAP in a long-running container, which is prepared with all needed dependencies.
Docker is a software that allows you to run Linux programs in a container on Linux, Mac or Windows with Docker Desktop.
Docker Compose is a tool for defining multi-container Docker environments in a single YAML configuration file and deploy it with a single command.
Create a base directory
You need a base directory, where GAP stores files and activities.
Import your activities by Choosing an Activity Source.
Creating a directory for docker compose stack
The compose project needs a directory, which includes the defining compose.yaml file.
The base directory can also be in this directory e.g. /docker/geo-activity-playground/playground.
mkdir -p /docker/geo-activity-playground/playground/docker/geo-activity-playground/compose.yaml
services:
geo-activity-playground:
container_name: geo-activity-playground
image: ghcr.io/martin-ueding/geo-activity-playground:latest
volumes:
- /docker/geo-activity-playground/playground:/data # if using a different base path, change the left side
ports:
- "127.0.0.1:5000:5000" # you can change the exposed (host) port on the left side
restart: unless-stoppedLimiting memory usage
Each worker process needs roughly 400 MB of memory. GAP picks the number of workers from the CPU cores and the memory limit of the container, so on a small machine it starts fewer of them automatically. If you want to trim it further, set the environment variables in the compose file:
environment:
GAP_WORKERS: 1
GAP_THREADS: 2Downloading the image and running the container
cd /docker/geo-activity-playground
docker compose up -dThis will start the webserver on your local host: http://127.0.0.1:5000/.
If you want to open GAP to your local network, use "5000:5000" in the ports section.
Note that port 5000 may not be available on macOS because of AirPlay, so you can map to another host port e.g. "127.0.0.1:8000:5000" in the ports section.
Then you can open http://127.0.0.1:8000/ in your browser.
Stopping the container
You can temporarily stop the container (it restarts on reboot with the option restart: unless-stopped) with:
docker stop geo-activity-playgroundand start again with:
docker start geo-activity-playgroundTo permanently stop the docker compose stack, use:
cd /docker/geo-activity-playground
docker compose downUpdating the image and redeploy the container
cd /docker/geo-activity-playground
docker compose pull
docker compose up -d --force-recreate