Alma Inventory API application that can be launched using Docker on Mac, Linux, or Windows.
For background on the application, see the Ex Libris Developer Blog post.
- Docker Desktop (v20.10+) or Docker Engine with the Compose plugin
- Git
- An Ex Libris Alma API key with read-only access to the Bibs and Configuration APIs
Note: This application runs PHP 8.2 inside the container, with full compatibility fixes in place. No local PHP installation is required.
-
Clone the repository
git clone https://github.com/dlingley/alma_inventory_docker.git cd alma_inventory_docker -
Configure your Alma API key
Copy the example environment file and add your key:
cp .env.example .env
Open
.envand replaceyour_api_key_herewith your actual Alma Shelflist API key:ALMA_SHELFLIST_API_KEY=your_actual_keyThe key is picked up automatically by
key.phpat runtime.
Alternatively, you can editkey.phpdirectly and hard-code the key — but using.envkeeps secrets out of source control. -
Build and start the container
# Modern Docker CLI (v20.10+) docker compose up # Legacy standalone docker-compose docker-compose up
-
Open the application
Navigate to http://localhost:8080 in your browser.
You should see your list of Alma libraries in the drop-down list. -
Customise
index.phpto match your institution:- Update the
id="itemType"<select>options to match the material types enabled in Alma. - Update the
id="policy"<select>options to match the item policy types defined in Alma.
- Update the
| Variable | Description |
|---|---|
ALMA_SHELFLIST_API_KEY |
Alma API key with read-only Bibs & Configuration access |
Values can be set in the .env file (recommended) or passed directly to Docker via the environment: key in docker-compose.yml.
Port 8080 is already in use
Change the host port in docker-compose.yml:
ports:
- 9090:80 # use any free port on the leftThen open http://localhost:9090 instead.
The drop-down list is empty / API errors
- Confirm your
ALMA_SHELFLIST_API_KEYis correct and has read-only access to Bibs and Configuration. - Check the container logs:
docker compose logs app
Permission errors on the cache directory
The cache/ directory must be writable by the www-data user. The Dockerfile sets this automatically. If you see permission errors after a bind-mount change, run:
docker compose exec app chown -R www-data:www-data /srv/app/cacheChanges to PHP files are not reflected
The docker-compose.yml mounts the project directory into the container as a volume, so edits to PHP files take effect immediately without rebuilding. If you change the Dockerfile or add new dependencies, rebuild with:
docker compose up --buildA standalone regression test suite validates the complex Dewey and LC call number sorting logic:
docker compose exec app php test_sort.phpIf you modify SortCallNumber.php, always rely on test_sort.php to ensure you haven't introduced regressions in volume subpart parsing (e.g. t.2:bk.1) or case-sensitive cutter logic.
The Docker setup is intended for local development and testing. For production, deploy the PHP source files to your institution's web server environment (Apache/Nginx + PHP 8.2+) and set the ALMA_SHELFLIST_API_KEY environment variable through your server's configuration.
The Docker setup is based on the PHP official image with Apache.