Installing an app in container that requires mssql database

Hi,

Possibly a simple question but having trouble finding information on the topic.

I’m investigating if I can move a 3rd party application to docker.

It’s a Java app that includes a tomee component and mssql db.

It requires an installation that can done via command line and installation script, however requires connection and setup of an mssql database.

I want to have the app (with java and tomee) running in one container and the mssql database running in another.

Is this possible?

Could the installation of the app be done during the docker build? If so, how would I reference the database?

Short answer: yes.
Slightly longer answer: yes, all what you’ve suggested can be done using docker and/or docker-compose.

There are several base images for mysql/mariadb as there’re for Java JRE. All can be found at https://hub.docker.com/
But … just stuffing an app inside a container is not a easy nor trivial as it sounds. A (very) good planning of volumes, network setup and configuration is absolute mandatory !

First draw a map of all “Interfaces” that the container will have with the “outside” world. (A bit of paper will do :wink: )
Bare in mind that the app will run only inside the container and won’t interact with the host unless you decide/configure that.
Check the documentation regarding volumes, ports and maybe networks …
Do you need access to config files ? Certs that may change ? Logfiles ?
Also, the installation of your Java app can’t be interactive at all during the build process of the container.

Now, you haven’t give us many details about the app so I can’t give any further advice …