Docker
On this page, you can find instructions on how to install MIND using Docker and how to update a Docker installation.
Installation¶
Time settings¶
Make sure to set all time related settings (time, date, timezone, etc.) correct on your computer, as MIND depends on it to work correctly.
Install Docker¶
The first step is to install Docker if you don't have it installed already. The official Docker documentation hub offers great instructions on how to install docker CLI and Docker Desktop. Take notice of whether you installed the 'Docker CLI' (the Docker documentation also calls this 'Docker CE') or 'Docker Desktop', for future instructions.
Quick introduction to Docker
Docker allows you to create little virtual computers, called 'containers'. You can run an application inside these containers. This is useful because you decide how much resources these containers can use, and what access these applications get to "the outside". It makes it safer and installation easier. It makes it safer because the application only has access to folders on the computer that you explicitly give it access to, and makes installation easier because you don't have to make sure that everything is set up properly, as the developer will ensure that.
Allowing folders and network connections through the container is done using 'mapping'. For example, you can map the folder D:\MIND_db on the host to the folder /app/db inside the container. Then everything in the host folder is visible to the application via the folder mapped inside the container. Mapping network ports works in a similar manner.
When you turn off a container, all changes to files and folders inside the container are lost (e.g. the database). This is so that the environment inside the container is always the same when starting up. In order to save a file/folder permanently, it has to be stored on the host and then mapped to somewhere inside the container.
Create place for the database¶
MIND needs a permanent place to put the database file. This can be a Docker volume or a folder on the host machine.
Following the Linux standards, we suggest the folder /opt/MIND/db. This is not mandatory however. You are allowed to create a folder anywhere you like.
If your Linux distro offers it, create the desired folder using the UI. Otherwise, create it with the following shell command (replace /path/to/directory with the desired path):
The user that the container runs as will need read, write and execution permissions. You can change the user that the container runs as using the PUID (user) and PGID (group) environment variables when launching the container later. The folder also needs to either be owned by that user, be owned by a group that the user is a part of, or have sufficient permissions so that any user can use the folder.
Following MacOS standards, we suggest the folder /Applications/MIND/db. This is not mandatory however. You are allowed to create a folder anywhere you like.
Create the desired folder using the UI or with the following shell command (replace /path/to/directory with desired path):
The user that the container runs as will need read, write and execution permissions. You can change the user that the container runs as using the PUID and PGID (for the group) environment variables when launching the container later. The folder also needs to either be owned by that user, be owned by a group that the user is a part of, or have sufficient permissions so that any user can use the folder.
There is no defined standard for Windows on where to put such a folder. We suggest a path like C:\apps\MIND\db or D:\MIND\db. This is not mandatory however. You are allowed to create a folder anywhere you like.
Create the desired folder either using the Windows Explorer or using the following Powershell command:
Launch container¶
Now we can launch the container.
The command to get the Docker container running can be found below. But before you copy, paste and run it, read the notes below!
A few notes about this command:
- If you're using a folder on the host machine instead of a docker volume to store the database file, replace
mind-dbwith the path to the host folder. It's mapped to/app/dbinside the container.
Examples
-v "/opt/MIND/db:/app/db"-v "C:\apps\MIND\db:/app/db"
- If you want to run MIND on a different port, you can do that by replacing the left
8080with the desired port.
Examples
-p 8009:8080to be available on8009-p 443:8080to be available on443-p 8080:8080to be available on8080
-
You can change the user and group that the application inside the container runs as using the PUID (user) and PGID (group) environment variables.
-
Set the
TZenvironment variable to the timezone database name of your timezone (value ofTZ identifieron webpage).
The contents of the docker-compose.yml file are below. The source file can also be found on GitHub. But before you copy, paste and run it, read the notes below!
services:
mind:
container_name: mind
image: mrcas/mind:latest
restart: unless-stopped
environment:
- PUID=0
- PGID=0
- TZ=Etc/UTC
volumes:
- "mind-db:/app/db"
ports:
- 8080:8080
volumes:
mind-db:
Then run the following command to start the container. Run this command from within the directory where the docker-compose.yml file is located.
A few notes about the docker-compose.yml file:
- If you're using a folder on the host machine instead of a docker volume to store the database file, replace
mind-dbwith the path to the host folder. It's mapped to/app/dbinside the container.
Examples
- "/opt/MIND/db:/app/db"- "C:\apps\MIND\db:/app/db"
- If you want to run MIND on a different port, you can do that by replacing the left
5656with the desired port.
Examples
- 8009:8080to be available on8009- 443:8080to be available on443- 8080:8080to be available on8080
-
You can change the user and group that the application inside the container runs as using the PUID (user) and PGID (group) environment variables.
-
Set the
TZenvironment variable to the timezone database name of your timezone (value ofTZ identifieron webpage).
-
Click the search bar at the top and search for
mrcas/mind. -
Click
Runon the entry sayingmrcas/mind. -
Open
Imagesand on the right, underActions, click the play/run button formrcas/mind. -
Expand the 'Optional settings'.
-
For the
Container name, set the value tomind. -
For the
Host port, set the value to8080. Set it to a different value if you want to run MIND on a different port. -
For the
Host path, set the value tomind-dbif you are using a Docker volume for the database. Otherwise, set it to the path to the folder on the host. Set the accompanyingContainer pathto/app/db. -
Under
Environment Variables, set theVariablefield toTZand theValuefield to the timezone database name of your timezone (value ofTZ identifieron webpage). -
You can change the user and group that the application inside the container runs as using the PUID (user) and PGID (group) environment variables. If so, add another environment variable using the plus button on the right. Set the
Variablefield toPUIDand theValuefield to the ID of the desired user. Add yet another environment variable using the plus button on the right. Set theVariablefield toPGIDand theValuefield to the ID of the desired group.
Check Setup After Installation¶
Now that the container is up and running, you can access it at http://localhost:8080. Check out the Setup After Installation page for instructions on how to configure MIND so that it works properly.
Updating¶
Below you can find instructions on how to update an install. In order for the database to properly migrate, it's advised to upgrade minor version by minor version (i.e. v1.0.0, v1.1.0, v1.2.0, etc.).
If needed, run these commands with sudo. It is assumed that the name of the container is mind (which is set using the --name option in the command).
docker container stop minddocker container rm minddocker image rm mrcas/mind:latest- Repeat the steps of launching the container.
If needed, run these commands with sudo. You need to be in the same directory as the docker-compose.yml file when running these commands.
docker-compose downdocker-compose pulldocker-compose up -ddocker image prune -f
- Open
Containersand locate themindcontainer in the list. - Click the stop button on the right, then the delete button.
- Open
Imagesand locate themrcas/mindimage in the list. - Click the delete button on the right.
- Repeat the steps of launching the container.