Sign inSign up

mobiusoffice/evergreen-ils

By mobiusoffice

Updated 6 days ago

Evergreen ILS for easy local testing

Image
Web servers
Content management system
Databases & storage
9

10K+

mobiusoffice/evergreen-ils repository overview

Evergreen ILS Containerized Server

This project is where we publish docker containers fore each version of Evergreen. A self contained ubuntu 16.04/18.04/20.04/22.04/24.04 server with postgres 9.5/9.6/10/15. Web based staff client and xul runner staff client included (pre EG 3.2). The Evergreen global admin account is defaulted to: admin/demo123

Mapping ports

When running the container, you will need to allow certain ports to be passed into the container:

Reasondocker switch
Standard Web-p 80:80
Standard SSL-p 443:443
SIP-p 6001:6001
Z39.50-p 210:210
SSH-p 32:22
PostgreSQL-p 5433:5432

Hostname

provide a hostname for the container so we don't let docker make one up. If the made-up hostname starts with a numeric value, opensrf will fail to start

-h app.evergreen.com

Full docker command example

docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 -p 32:22 -p 5433:5432 -h app.evergreen.com mobiusoffice/evergreen-ils

Post boot

Once running, you should see an ansible script kick off, which will end with

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=74   changed=53   unreachable=0    failed=0

Once you see that, the server is setup and ready for connections. Keep in mind if you press CTRL+C - the server will die. Please use CTRL+pq instead to leave it running.

The SSH login to the docker container is defaulted to: user/password

The Evergreen global admin account is defaulted to: admin/demo123

The Git repo that is used to create the images is here: Github Project

Everything below this line is if you're interested in the development container

Dev container

We have discontinued the ejabberd dev container. Only Redis dev container now.

The idea is that you will inject your Evergreen git repository into the container and it will mirror your changes in the server environment.

WARNING: Make sure that your locally cloned Evergreen git repository does NOT have Windows line endings. Unix only.

Linux hosts

docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 -p 32:22 -p 5433:5432 -v /home/user/Evergreen:/home/opensrf/repos/Evergreen -h test.evergreen.com mobiusoffice/evergreen-ils:dev

Windows hosts

docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 -p 32:22 -p 5433:5432 -v //c/users/blake/Documents/GitHub/Evergreen:/home/opensrf/repos/Evergreen -h test.evergreen.com mobiusoffice/evergreen-ils:dev

This container (evergreen-ils:dev) is designed to have your local filesystem mounted into the container so that you can edit Evergreen files on your local machine. You will want to clone the Evergreen git repository onto your computer and then pass the folder path into the docker run command with the "volume" switch (-v). See above. Be sure and update the example.

This container makes symlinks from your Evergreen repository into various folders in /openils. There are six symlinks:

localdestination
/home/opensrf/repos/Evergreen/Open-ILS/web/js/ui/default/staff/openils/var/web/js/ui/default/staff
/home/opensrf/repos/Evergreen/Open-ILS/web/eg2/openils/var/web/eg2
/home/opensrf/repos/Evergreen/Open-ILS/src/perlmods/lib/OpenILS/usr/local/share/perl/5.34.0/OpenILS
/home/opensrf/repos/Evergreen/Open-ILS/web/opac/deps/openils/var/web/opac/deps
/home/opensrf/repos/Evergreen/Open-ILS/src/templates/openils/var/templates
/home/opensrf/repos/Evergreen/Open-ILS/src/templates-bootstrap/openils/var/templates-bootstrap
Restarting Evergreen services

Once the container is running, you can cause the container to restart Evergreen services. You can do this by saving a file in the root of the Evergreen git repository called "eg_restart_go". There is a cron job that runs every minute that looks for that file, if found, it will be deleted and the software will proceed to restart the Evergreen stack, including Ejabberd. You can see the output of the restart while it's restarting in the file "eg_restart_go_screenoutput"

Rebuilding Evergreen Angular

Once the container is running, you can cause the container to rebuild the eg2 Angular client. You can do this by saving a file in the root of the Evergreen git repository called "eg_rebuild_angular". This will only take one or two seconds to trigger a rebuild. The build process can take a minute or so. You can see the output of the rebuild while it's rebuilding in the file "eg_rebuild_angular_screenoutput"

Hot swap the database

Once the container is running, you can cause the container to create a new database. It will create the database from your current Evergreen working directory. There is a file in the root of your Evergreen folder called db_control.txt. Which is a space delimited file. There are three columns:

column1column2column3
database_namedatabase_typeuse_this_flag (*)

The file looks like this to begin with:

evergreen standard *
evergreen_enhanced enhanced

If you move the asterisks to the second line, the container will update the opensrf configuration to point to that database and restart the services automatically.

You can introduce any number of new lines into this file, and without the asterisks. Which will cause the container to immediately create the desired database on postgres with the dataset that you've indicated [standard|enhanced]

The log output of the script doing the work is written to: db_switch.log

Angular npm watch locally

It's possible to use Angular watch on your local machine (outside of the dev container) so that your code changes are reflected more quickly.

To do that, you need to get into the shell of the running dev container and make the following tweaks:

# Remove the existing symlink
rm -f /openils/var/web/eg2

# Create a new symlink pointing to the Evergreen directory
ln -s /home/opensrf/repos/Evergreen/Open-ILS/web/eg2 /openils/var/web/eg2

Now you can run "npm run watch" on your local environment

Tag summary

Content type

Image

Digest

sha256:9fdaf2cdf

Size

1.3 GB

Last updated

about 1 month ago

docker pull mobiusoffice/evergreen-ils