I have the project in Intellij with gradle. This is the application.properties file.
security.basic.enabled=false
spring.jpa.hibernate.ddl-auto=create
spring.datasource.url=jdbc:mysql://localhost:3306/pai
spring.datasource.username=pai
spring.datasource.password=kasztan
This is application.yml.
spring:
  datasource:
    url: jdbc:mysql://localhost:3306/pai
    pooled: true
    driverClassName: com.mysql.jdbc.Driver
    dialect: org.hibernate.dialect.Dialect
    username: pai
    password: kasztan
    platform: mysql
    initialize: false
  jpa:
    database-platform: org.hibernate.dialect.Dialect
This is Dockerfile.
FROM openjdk:8-jdk-alpine
VOLUME /tmp
ENV JAVA_OPTS=""
COPY gs-spring-boot-docker-0.1.0.jar /home/app.jar
EXPOSE 8080
CMD java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /home/app.jar
The docker image has been built successfuly. When I run image using ID of image at the end I get the following error.
2018-03-18 10:46:27.155 ERROR 6 --- [ost-startStop-1] o.a.tomcat.jdbc.pool.ConnectionPool      : Unable to create initial connections of pool.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
What can be the problem?