Develop Nextcloud Maps locally using Docker, with a custom git-based snapshot system for easily saving and restoring the complete state of the local Nextcloud server instance.
The MySQL database and Nextcloud server web root are stored as Docker bind mounts to local directories (see docker-compose.yml
):
/var/local/volumes/maps_db
/var/local/volumes/maps_www
Modifications to these Nextcloud files while developing code take immediate effect for an efficient development workflow.
Snapshots are stored in a local git repo at /var/local/snapshots/maps
. To take a snapshot, execute
maps_snapshot_create 'Your commit message'
To restore a snapshot, execute
maps_snapshot_restore 3a6af611
- Create a directory named
maps
in your home folder (i.e.~/maps
). - Copy the files below into this folder (unless they are already present from a
git clone
of this repo). - Create the directories
/var/local/volumes/
and/var/local/snapshots/maps
. - Run the
maps/init.sh
script to construct the Nextcloud instance and install the Maps app. - Visit http://localhost:8000 in a web browser to log in to the fresh server. The default username is
admin
with passwordpassword
.
The files below should reside in ~/maps
. The code below assumes the containers are automatically named maps_app_1
and maps_db_1
, which should be the case if docker-compose up -d
is executed from a working directory called maps
using the docker-compose.yml
file included.
Use the official Nextcloud Docker image for a specific version. Installs additional dependencies needed to run the make
command for the Maps app installation.
Define the two containers and the bind mounts for the dynamic, persistent data storage. Specify the Apache listening port 8000
.
Copy the persistent storage "volumes" to the snapshot git repo and commit the changes.
Restore the specified snapshot (by git commit hash) to the Docker bind mount directories, overwriting any existing files.
Script to automate the creation of the Docker containers and to provision the new Nextcloud server with the latest Nextcloud Maps app (master
branch).