feat: added spring profile setup for env variables
This commit is contained in:
parent
c4b9c14706
commit
91d4f4245f
4 changed files with 10 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -6,6 +6,9 @@
|
|||
.classpath
|
||||
.env
|
||||
|
||||
# Ignore profile-specific properties files
|
||||
application-*.properties
|
||||
|
||||
*.iml
|
||||
.DS_Store
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ services:
|
|||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: ${DB_ADDRESS}
|
||||
SPRING_DATASOURCE_URL: ${DB_ADDRESS}/${DB_NAME}
|
||||
SPRING_DATASOURCE_USERNAME: ${DB_USER}
|
||||
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD}
|
||||
depends_on:
|
||||
|
|
|
@ -3,13 +3,14 @@ package com.application.munera;
|
|||
import com.application.munera.repositories.ExpenseRepository;
|
||||
import com.vaadin.flow.component.page.AppShellConfigurator;
|
||||
import com.vaadin.flow.theme.Theme;
|
||||
import javax.sql.DataSource;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.sql.init.SqlDataSourceScriptDatabaseInitializer;
|
||||
import org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* The entry point of the Spring Boot application.
|
||||
*
|
||||
|
|
|
@ -2,12 +2,16 @@ server.port=${PORT:8080}
|
|||
logging.level.org.atmosphere = warn
|
||||
spring.mustache.check-template-location = false
|
||||
|
||||
# Activate the default profile
|
||||
spring.profiles.active=dev
|
||||
|
||||
# Launch the default browser when starting the application in development mode
|
||||
#vaadin.launch-browser=true
|
||||
# PostgreSQL configuration.
|
||||
spring.datasource.url = ${DB_ADDRESS}/${DB_NAME}
|
||||
spring.datasource.username = ${DB_USER}
|
||||
spring.datasource.password = ${DB_PASSWORD}
|
||||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
|
||||
spring.jpa.hibernate.ddl-auto = update
|
||||
# To improve the performance during development.
|
||||
# For more information https://vaadin.com/docs/latest/integrations/spring/configuration#special-configuration-parameters
|
||||
|
|
Loading…
Reference in a new issue