omoponfhir/omoponfhir-main

Error 404 on http://localhost:8080/omoponfhir

Closed this issue · 6 comments

I just tried setting up an omoponfhir instance on my desktop using the README from this omoponfhir-main and linking it to the smart-postgres SQL database that I forked from the link provided in the README. I can get the Tomcat to open at localhost:8080, but http://localhost:8080/omoponfhir3 throws an Error 404.

Here is what my Dockerfile looks like:

#Build the Maven project
FROM maven:3.6.1-alpine as builder
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN mvn clean install

#Build the Tomcat container
FROM tomcat:alpine
#set environment variables below and uncomment the line. Or, you can manually set your environment on your server.
ENV JDBC_URL=jdbc:postgresql://omopv5fhir-pgsql:5432/smart-postgres?currentSchema=omop_v5 JDBC_USERNAME=smart-postgres JDBC_PASSWORD=i3lworks
RUN apk update
RUN apk add zip postgresql-client

# Copy GT-FHIR war file to webapps.
COPY --from=builder /usr/src/app/omoponfhir-stu3-server/target/omoponfhir-stu3-server.war $CATALINA_HOME/webapps/omoponfhir3.war

EXPOSE 8080

I don't know if I'm not typing something correctly into one of the environment variables or if I have to change things in my docker-compose.yml file. I'm not sure. This is my first time working with Docker containers.

Do you have any thoughts?

The URL issue was a typo. I actually tried it with http://localhost:8080/omoponfhir3/ and the other prefab URLs and they do not work.

I am completely unfamiliar with Docker. Would you explain in a general sense how I would go about setting up the communication? I have the desktop version and CLI-tools for Docker

Sorry to leave you hanging @myungchoi . I tried to resolve the issue by attaching smart-postgres to the omoponfhir-main_default bridge that comes with the installation and that didn't solve the problem. Here is the output of my sudo call:

CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                   PORTS                    NAMES
ad6ca8813ebd        omoponfhir-main_omoponfhir   "catalina.sh run"        13 days ago         Up 44 hours              0.0.0.0:8080->8080/tcp   omoponfhir-main_omoponfhir_1
338cdf426eef        smart-postgres:latest        "docker-entrypoint.s…"   2 weeks ago         Up 10 minutes            0.0.0.0:5432->5432/tcp   smart-postgres
2b9724195181        docker/getting-started       "/docker-entrypoint.…"   2 weeks ago         Exited (0) 13 days ago                            funny_kirch

In case it is helpful, this is the docker inspection results for the omoponfhir-main_default network after I connected smart-postgres to it:

"Name": "omoponfhir-main_default",
        "Id": "bfb4d8ede0422a4bd821eecc25d78a89918814c579607a645623f5d5da180c82",
        "Created": "2020-10-23T16:48:09.591035052Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.19.0.0/16",
                    "Gateway": "172.19.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "338cdf426eef836e655e3e5284d4052ef457930ca36e52759744bc0006aa4c43": {
                "Name": "smart-postgres",
                "EndpointID": "375b5b9084dab161b5776efef6237567912211afacf456a2dfb7a8de36d9e9f3",
                "MacAddress": "02:42:ac:13:00:03",
                "IPv4Address": "172.19.0.3/16",
                "IPv6Address": ""
            },
            "ad6ca8813ebdf2ab8450ced2915c71a5a40ec1fa6ae9d080cc954aa29dd8af3f": {
                "Name": "omoponfhir-main_omoponfhir_1",
                "EndpointID": "7caaedb082812055540e2425c9b86f3b106ea9cf0ac7231e9671de45eb13fc83",
                "MacAddress": "02:42:ac:13:00:02",
                "IPv4Address": "172.19.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {
            "com.docker.compose.network": "default",
            "com.docker.compose.project": "omoponfhir-main",
            "com.docker.compose.version": "1.27.4"
        }

@myungchoi Any thoughts on these?

This issue has been resolved!

In case anyone else has similar issues with connecting omopv5fhir-pgsql to omoponfhir-main, here is what worked for me:

Modifying variables when using the omopv5fhir-pgsql instructions

Your ENV variables in the Dockerfile for omopfhir-main should be updated as such

ENV JDBC_URL=jdbc:postgresql://smart-postgres:5432/postgres?currentSchema=omop_v5 JDBC_USERNAME=omop_v5 JDBC_PASSWORD=i3lworks
  • Breaking down the variables
    • JDBC_URL=jdbc:[dbclient]://[container-name]:[port-number]/[dbclient-command-form]?currentSchema=[POSTGRES_DB]
    • For currentSchema, JDBC_USERNAME, JDBC_PASSWORD look in the Dockerfile for omopv5fhir-pgsql
      • currentSchema, listed after POSTGRES_DB
      • JDBC_USERNAME, listed after POSTGRES_USER
      • JDBC_PASSWORD, listed after POSTGRES_PASSWORD