geonetwork / docker-geonetwork

Official Docker image repository for GeoNetwork
38 stars 39 forks source link

Bring docker-compose.yml to life, 1 master and 1 slave. #22

Open bor8 opened 5 years ago

bor8 commented 5 years ago

Hello, first I wanted to do this PR in the main repo core-geonetwork: https://github.com/geonetwork/core-geonetwork/pull/3775. At PascalLike's suggestion, now here.

(I think it makes sense to follow up on the documentary, too: https://github.com/docker-library/docs/blob/master/geonetwork/README.md. Let's see when I can do this.)

I brought in Docker Compose with this Commit. I also removed the postgres folder (the restart: always guarantees that the database does not have to be booted when Geonetwork starts (again)!), added HTTP proxy support, and added construction of the war file via Maven.

It can do no harm to change the password in the docker-compose.yml file.

A master and a slave can be created with:

git clone --branch master --single-branch https://github.com/bor8/docker-geonetwork.git
cd docker-geonetwork
sudo docker-compose build
sudo docker-compose up -d

(The sudo is not necessary if you have configured your system correctly: sudo usermod -aG docker <USERNAME> plus logout and login.)

It takes a while until the master and slave are built. Especially downloading the Maven files takes years.

Alternatively, if you want it to go faster and you don't want to build it yourself:

git clone --branch master --single-branch https://github.com/bor8/docker-geonetwork.git
cd docker-geonetwork
sudo docker-compose pull
sudo docker-compose up -d

If everything worked out, you can open master with http://localhost:8080/geonetwork/ and slave with http://localhost:4567/geonetwork/.

The slave automatically retrieves the latest data from the master every half hour.

Tested on Docker 18.09.5 and Docker-Compose 1.24.0 without HTTP proxy (but if necessary you only have to modify the .env and apt.conf files).