Skip to content

Instantly share code, notes, and snippets.

View andresavilesdev's full-sized avatar
🎯
Focusing

Andres Aviles andresavilesdev

🎯
Focusing
View GitHub Profile
@SpringBootApplication
public class GenMailApplication {
public static void main(String[] args) {
// configuring environment variables
Dotenv dotenv = Dotenv.configure().ignoreIfMissing().load();
dotenv.entries().forEach(entry ->
System.setProperty(entry.getKey(), entry.getValue())
services:
springboot-recaptcha:
image: springboot-recaptcha
container_name: spring-recaptcha-container
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
networks:
# Imagen modelo
FROM <image> -> eclipse-temurin:21.0.3_9-jdk
# Definir directorio raiz de nuestro contenedor
WORKDIR /root
# Copiar y pegar archivos dentro del contenedor
COPY ./pom.xml /root
COPY ./.mvn /root/.mvn
COPY ./mvnw /root
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/DATABASE_NAME?createDatabaseIfNotExist=true
spring.datasource.username=USERNAME
spring.datasource.password=PASSWORD
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver