I created small app what is using Hibernate and Spring boot. I have MySQL db on external server with some 123.123.12.123
IP address.
When I run this app locally (on Windows) via java -jar myapp.jar
there is no problem, app is starting and everything is ok. The problem is appear when I am try run this app in Docker. App even not start. There is HibernateException:
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
I am sure it is because I cannot connect to db. (I have same issue when I was trying connect locally and db was not available). So what should I do to fix it? This is my application.properties
:
spring.datasource.url=jdbc:mysql://123.123.12.123:3306/szoplist_db
spring.datasource.username=root
spring.datasource.password=my_passwd
EDIT:
I am running docker image via docker run -p 8080:8080 <IMAGE_ID>
.
Dockerfile:
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
ADD ${JAR_FILE} /app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Another apps (without db) with the same Dockerfile and run command works.