I am in process to dockerize my local server, on that have databases, application servers and all additional configuration to deploy my applications. Currently, i have created 3 docker containers that run application servers like Tomcat or WildFly, and exposed 80
, 8130
and 8080
ports this deployed applications are in Java and read and write data from/to my local database. On the persistence.xml
file for each app, i have configured the access via localhost
in my actual configuration that works ok without docker.
I want to connect the apps on the containers to database that correspond on the host machine, how can i do that?
I have created the containers like this:
docker run -d --name app_server1 -p 80:80 wildfly_website:1.0
docker run -d --name app_server2 -p 8130:8130 geoserver:1.0