Docker compose file for deploying your very own Local Handle Service (LHS) Server.
If you discover any typos or errors in this README.md, create an ISSUE with the relevant fix and I will make the changes accordingly. If you have any suggestions or improvements, please do the same.
- Docker v24 or above.
- Docker compose v2.17.0 or above.
- Clone this repository to a folder of your choice and switch to that directory.
git clone https://github.com/svicknesh/docker-handle-lhs /tmp/docker-handle-lhs
cd /tmp/docker-handle-lhs
- Switch to the
build
directory
cd build
- Build the image using tags of your preference
docker build --tag "git.openlab.itu.int/aims/lhs:latest" --tag "git.openlab.itu.int/aims/lhs:9.3.1" "$(pwd)"
- The LHS docker container image is now ready to be used.
- The following commands must be run as a normal user, ideally the same one with the
PUID
andPGID
setting. Create the folder to store the LHS configuration as the user
mkdir -p /home/ubuntu/lhs/test
- Run the container to initialize the information needed for the operations of an LHS. replacing
/home/ubuntu/lhs/test
with the actual folder to store LHS data. This folder must match what will be in thedocker-compose.yaml
docker run --rm -it -v /home/ubuntu/lhs/test:/home/lhs/data git.openlab.itu.int/aims/lhs
- Make sure to set the public address to a publicly reachable IP address and the bind address to
0.0.0.0
. This is important since we're running in a container and the IP address will differ during each run.
-
Refer to the sample
docker-compose.yaml
file fromhttps://github.com/svicknesh/docker-handle-lhs/raw/master/docker-compose.yml
-
Replace the image name with the image from the build process (if different, otherwise retain the image name).
-
Change the
PUID
andPGID
to your host usernameuid
andgid
if it's different from1000
for both. -
For volume mount, change the name to the preferred path on the host system (left part only, do NOT change the right part). Create the folder with the correct
uid
andgid
that matches step 3. -
Change the port numbers to your preferred port. Change both the ports on the left and right of the : to match. The LHS instance will listen on the configured port in config.dct and the host has to map the port accordingly.
-
This image will create the necessary configuration files for the LHS if they don't already exist. Remeber to match the ports and IP with the ones configured in step 5.
-
Start up the container
docker compose up -d
-
(For new setup) Send the generated
sitebndl.zip
from the data folder from host to a Naming Authority to obtain a prefix. -
Once the Naming Authority has allocated a prefix, edit the
/config.dct
file and do the following- Replace YOUR_PREFIX with the prefix allocated by the Naming Authority, for instance 11.1234 under "server_admins", "replication_admins", and "auto_homed_prefixes".
- Change the bind_address to 0.0.0.0 so that the instance can be reachable from the host.
-
(For future runs) Start the container as step 7.
-
Edit
docker-compose.yml
and add more LHS information as needed. Multiple instances can be run using the samedocker-compose.yaml
.
Feel free to use this as you see fit. It does not come with any warranty, implied or otherwise.