FHIR Chat · hapi + mysql in docker · hapi

Stream: hapi

Topic: hapi + mysql in docker


view this post on Zulip Vasyl Herman (Jan 23 2021 at 17:07):

Hi,
I have followed hapi-fhir-jpaserver-starter deploy with docker compose instruction and double checked a few times but it still doesn't work. http://localhost:8080 gives me HTTP Status 404
in docker-compose logs - nothing
where else I can check other logs to troubleshoot this issue.

the mysql service in docker-compose.yml:

  hapi-fhir-mysql:
    image: mysql:latest
    container_name: hapi-fhir-mysql
    restart: always
    environment:
      MYSQL_DATABASE: 'hapi'
      MYSQL_USER: 'admin'
      MYSQL_PASSWORD: 'admin'
      MYSQL_ROOT_PASSWORD: 'admin'

the application.yaml:

spring:
  datasource:
    url: 'jdbc:mysql://hapi-fhir-mysql:3306/hapi'
    username: admin
    password: admin
    driverClassName: com.mysql.jdbc.Driver

Please, help

view this post on Zulip Vasyl Herman (Jan 23 2021 at 17:36):

I feel like I need initial db. where I can find it?

view this post on Zulip Vasyl Herman (Jan 23 2021 at 18:42):

cat logs/catalina.2021-01-23.log part 1

view this post on Zulip Vasyl Herman (Jan 23 2021 at 18:43):

view this post on Zulip Vasyl Herman (Jan 23 2021 at 18:43):

view this post on Zulip Vasyl Herman (Jan 23 2021 at 18:44):

view this post on Zulip Lin Zhang (Jan 24 2021 at 02:13):

If you need to init db, you may want to add the db init script in the Dockerfile.

view this post on Zulip Frank Oemig (Jan 24 2021 at 09:03):

It is sufficient to create the intended db and add user with permission, eg with myphpadmin. Hapi does the rest.

view this post on Zulip Vasyl Herman (Jan 24 2021 at 09:15):

@Frank Oemig
The issue was mysql:latest in docker-compose yml. as soon as I changed it to mysql:5 it started working

view this post on Zulip Vasyl Herman (Jan 24 2021 at 09:18):

I am not sure if we need to fix the documentation
needs to be investigated ...

view this post on Zulip Frank Oemig (Jan 24 2021 at 09:20):

I need to check. I believe my one is running as latest.

view this post on Zulip Vasyl Herman (Jan 24 2021 at 09:20):

please do, I am wandering ...

view this post on Zulip Vasyl Herman (Jan 24 2021 at 09:21):

I have tried a bunch of options with the latest, unsuccessfully ...

view this post on Zulip Frank Oemig (Jan 24 2021 at 09:21):

I also do not use compose because mysql is used by others as well and I want to load the warfile from a volume.

view this post on Zulip Frank Oemig (Jan 24 2021 at 09:22):

So I need to recompile and reboot only w/o a new image.

view this post on Zulip Vasyl Herman (Jan 24 2021 at 09:25):

@Frank Oemig
so, you have an external mysql server?

view this post on Zulip Frank Oemig (Jan 24 2021 at 11:51):

I have a container with mysql that serves different applications.
And I do not want to update my FHIR image when updating my FHIR server. Therefore I load the warfile from a volume.

view this post on Zulip Frank Oemig (Jan 24 2021 at 12:50):

I have a container with mysql that serves different applications.
And I do not want to update my FHIR image when updating my FHIR server. Therefore I load the warfile from a volume.

view this post on Zulip Karl Fischer (Jan 25 2021 at 11:55):

Lin Zhang said:

If you need to init db, you may want to add the db init script in the Dockerfile.

Or maybe add a phpmyadmin container to your docker-compose file and create the database and user (for testing purposes)

view this post on Zulip Lin Zhang (Jan 25 2021 at 13:26):

@Karl Fischer POSITIVE:clap: Thanks.


Last updated: Apr 12 2022 at 19:14 UTC