Docker Installation
How to install OpenDataBio with Docker
2 minute read
The easiest way to install and run OpenDataBio is using Docker and the docker configuration files provided, which contain all the needed configurations to run ODB. Uses nginx and mysql, and supervisor for queues
Docker configuration files provided for test or development only
Docker files
laraverl-app/
----docker/*
----./env.docker
----docker-compose.yml
----Dockerfile
----Makefile
These are adapted from this link, where you find a production setting as well.
Installation
Download OpenDataBio
- Make sure you have Docker and Docker-compose installed in your system;
- Check if your user is in the docker group created during docker installation;
- Download or clone the OpenDataBio in your machine;
- Make sure your user is the owner of the opendatabio folder created and contents, else change ownership and group recursively to your user
- Enter the opendatabio directory
- Edit and adjust the environment file name
.env.docker
(optional) - To install locally for development just adjust the following variables in the Dockerfile, which are needed to map the files owners to a docker user;
UID
the numeric user your are logged in and which is the owner of all files and directories in the opendatabio directory.GDI
the numeric group the user belongs, usually same as UID.
- File
Makefile
contains shortcuts to the docker-compose commands used to build the services configured in thedocker-compose.yml
and auxiliary files in thedocker
folder. - Build the docker containers using the shortcuts (read the Makefile to undersand the commands)
make build
- Start the implemented docker Services
make start
- See the containers and try log into the laravel container
docker ps
make ssh #to enter the container shell
make ssh-mysql #to enter the mysql container, where you may access the database shell using `mysql -uroot -p` or use the laravel user
- Install composer dependencies
make composer-install
- Migrate the database
make migrate
- You may also replace the Locations and Taxons tables with seed data:
make seed-odb
- If worked, then Opendatabio will be available in your browser http::/localhost:8080.
- Login with superuser
admin@example.org
and passwordpassword1
- Additional configurations in these files are required for a production environment and deployment;
Data persistence
The docker images may be deleted without loosing any data. The mysql tables are stored in a volume. You may change to a local path bind.
docker volume list
Using
See the contents of Makefile
make stop
make start
make restart
docker ps
...
If you have issues and changed the docker files, you may need to rebuild:
#delete all images without loosing data
make stop
docker system prune -a #and accepts Yes
make build
make start
Last modified January 11, 2022: Add PUT API info and how to customize layout (12ea724)