Estou tendo o mesmo problema:
application-prod.properties:
spring.datasource.url=${DATASOURCE_URL}
spring.datasource.username=${DATASOURCE_USERNAME}
spring.datasource.password=${DATASOURCE_PASSWORD}
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=false
spring.mail.host=${MAIL_HOST}
spring.mail.username=${MAIL_USER}
spring.mail.password=${MAIL_PASSWORD}
spring.mail.port=587
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
app.security.jwt.secret=${APP_JWT_SECRET}
app.env:
SPRING_PROFILES_ACTIVE=prod
SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/codechella
SPRING_DATASOURCE_USERNAME=codechella_user
SPRING_DATASOURCE_PASSWORD=codechella_pwd
MAIL_HOST=smtp.gmail.com
MAIL_USER=mail_user
MAIL_PASSWORD=mail_pwd
APP_JWT_SECRET=jwt_secret
Docker compose:
version: '3'
services:
mysql:
image: mysql:8.0.36
env_file: ./env/mysql.env
volumes:
- ./mysql-data:/var/lib/mysql
restart: unless-stopped
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
interval: 5s
timeout: 5s
retries: 10
app:
build:
context: .
env_file: ./env/app.env
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
volumes:
mysql-data: