Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page describes the steps to launch WCI Terminology Server with mini version of SNOMEDCT 2014. The steps assume a user is running this locally on their computer.

Getting the Docker Images

Code Block
languagebash
> docker pull nmarques/wci_termserver:1.5.1

This may take a few minutes as there are several images to download.

Starting the Docker Container

Input

Code Block
> docker run -p 8080:8080 nmarques/wci_termserver:1.5.1

Output if not running in background (-d)

Code Block
Launch mysqld
Starting MariaDB database server: mysqld ..
Create database and user
Load the data into the database
Launch the server
..... more not shown

Open browser to http://localhost:8080/index.html.

Stopping the Docker Container

Code Block
languagebash
> docker ps
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                    NAMES
a5c6a8320327        nmarques/wci_termserver:1.5.1   "/bin/sh -c /root/ru…"   3 minutes ago       Up 3 minutes        0.0.0.0:8081->8080/tcp   brave_easley
> docker stop a5c6a8320327

The container Id unique each time a the Docker Container is started.

The Dockerfile

Code Block
languagebash
FROM openjdk:8-jdk

WORKDIR /root

# Run the latest MySQL/MariaDB
RUN apt-get update && apt-get install -y lsb-release maven git
RUN apt-get -y install mysql-server
# download tomcat webrunner
RUN curl -o webapp-runner.jar http://repo1.maven.org/maven2/com/github/jsimone/webapp-runner/8.5.29.0/webapp-runner-8.5.29.0.jar

# Pull and build the code
RUN git clone https://github.com/WestCoastInformatics/UMLS-Terminology-Server.git
RUN cd UMLS-Terminology-Server && git checkout develop && mvn clean install && cd -

# Load the data and indexes (alternatively, these could pull from a public S3 bucket)
COPY data/tsdb.sql /root/tsdb.sql
RUN mkdir /root/indexes
COPY data/tsdb-indexes.zip /root/indexes/tsdb-indexes.zip
RUN cd /root/indexes && unzip tsdb-indexes.zip && rm tsdb-indexes.zip && cd -
COPY data/config/* /root/config/

# copy other resources
COPY create.sql /root/create.sql
COPY config.properties /root/config.properties
COPY run.sh /root/run.sh
RUN chmod 755 /root/run.sh

# Run the command when deployed
CMD /root/run.sh

All Docker container definitions begin with an existing definition. In this case, with openjdk:8-jdk.

Lines 6-9:

Install Apache Maven, MySQL, Tomcat webrunner,

Lines 11&12:

Pull code from GitHub and use Maven to build.

Lines 16-20:

File tsdb.sql is a dump file from a MySQL database used here to populate the database. Unzip Lucene index files and copy configuration files acronyms.txt, spelling.txtj and spelling indexes.

Lines 23-26:

Copy file create.sql creates the tsdb database adds a user and grants the user permissions to query the database. Copy file config.properties used by the application. Copy run.sh which starts mysqld, runs mysql command to create the database, runs mysql command to load the data from tsdb.sql and then lauches webapp-runner.jar.

Additional sources for Docker documentation.

https://docs.docker.com/

Docker glossary: https://docs.docker.com/glossary/

Docker for Windows: https://docs.docker.com/docker-for-windows/install/

Docker for Mac: https://docs.docker.com/docker-for-mac/install/

Docker for Linux: https://docs.docker.com/install/linux/docker-ce/ubuntu/

Know issues:

  1. After clicking Launch Browser you will get an error. This will not impact your search. Click in the 'X' in in the red rectangle box and the error message will disappear for this session. This will be fixed in the future.

  2. Clicking on the API link in the header will show a message “Can't read from server. It may not have the appropriate access-control-origin settings.” Please use https://snomed.terminology.tools/swagger.html to view the API or https://snomed.terminology.tools:443/swagger.json to import the API into Postman.