Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute OpenHospital GUI with Docker compose #3

Merged
merged 3 commits into from
Apr 15, 2019
Merged

Execute OpenHospital GUI with Docker compose #3

merged 3 commits into from
Apr 15, 2019

Conversation

pviotti
Copy link
Collaborator

@pviotti pviotti commented Apr 14, 2019

This PR adds the OpenHospital Swing-based GUI to the Docker Compose file, so that one can run both database and GUI with a simple docker-compose up.

Notes:

  • I had to modify startup.sh because it wasn't working - several folders of those included in the Java classpath do not exist, and the one created by the Maven build (/target/*) are not present
  • I only tested this on Linux (and I suspect there will be issues at using this on Windows since it uses X11 for graphics..)
  • the Docker file for the GUI downloads and builds both core and gui with Maven. I guess it would be quicker to build if we published the Maven artifacts somewhere.
  • running GUI applications in Docker is less than trivial, as you have to use a non-root user, and somehow map the X11 server configuration in the container to a local one on the host machine (see for instance this)
  • the Docker image for the GUI is published here as pviotti/openhospital, and can be run separately (tested only on Linux) with this command: docker run -ti --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/$(whoami)/.Xauthority:/home/ohuser/.Xauthority:ro -e DISPLAY --network=host pviotti/openhospital:latest
  • in the Docker file I used my fork of this repo since the startup.sh file does not work on the main repo

Related issues: OP-68 (and child taks)

@mwithi
Copy link
Member

mwithi commented Apr 15, 2019

Hi Paolo, I have used Xming as X server for Windows and introduced the ENV varaible DISPLAY=<my_ip>:0. Nevertheless it shows me a problem of DB connection:
http://www.pastebin.it/5781/

DB connection failed

@pviotti
Copy link
Collaborator Author

pviotti commented Apr 15, 2019

It looks like the graphic server (Xming) is fine, as it manages to show the Swing dialog box. The error is about the connection with the DB, which should be listening on port 3306. So if you just started the GUI container then the error is normal - otherwise, if you started also the db container (for instance with docker-compose up) there's some networking issue.

@mwithi
Copy link
Member

mwithi commented Apr 15, 2019

Ok, I thought your container on dockerhub was all-in-one. Now I've started the DB with docker-compose up and changed docker-compose.yml with:

environment:
     - DISPLAY=192.168.1.8:0

done

It seems slightly slow but definitely we can say that at least it works!

@mwithi mwithi changed the base branch from master to docker April 15, 2019 17:27
@mwithi mwithi merged commit 8450951 into informatici:docker Apr 15, 2019
ArnaudFonzam referenced this pull request in ArnaudFonzam/openhospital-gui Feb 28, 2024
…on_context

Op 65 to externalize application context
ArnaudFonzam referenced this pull request in ArnaudFonzam/openhospital-gui Feb 28, 2024
ArnaudFonzam referenced this pull request in ArnaudFonzam/openhospital-gui Feb 28, 2024
mwithi pushed a commit that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants