Adding cloud configurations to service modules
This commit is contained in:
parent
3052d3aab6
commit
1d2969fe5b
14 changed files with 96 additions and 29 deletions
23
.vscode/launch.json
vendored
Normal file
23
.vscode/launch.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "UserServiceApiApplication (DEV DEBUG)",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "br.com.rayankonecny.userserviceapi.UserServiceApiApplication",
|
||||||
|
"projectName": "user-service-api",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "java",
|
||||||
|
"name": "ConfigServerApplication",
|
||||||
|
"request": "launch",
|
||||||
|
"mainClass": "br.com.rayankonecny.configserver.ConfigServerApplication",
|
||||||
|
"projectName": "config-server",
|
||||||
|
"env": {
|
||||||
|
"CONFIG_SERVER_URI": "https://forgeo-olymp.duckdns.org/rayankonecny/config-server.git",
|
||||||
|
"CONFIG_SERVER_USERNAME": "rayankonecny",
|
||||||
|
"CONFIG_SERVER_PASSWORD": "550919ca9d3411b0611d697f6acb6744e4510000",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
|
@ -2,4 +2,5 @@
|
||||||
"java.compile.nullAnalysis.mode": "disabled",
|
"java.compile.nullAnalysis.mode": "disabled",
|
||||||
"java.debug.settings.onBuildFailureProceed": true,
|
"java.debug.settings.onBuildFailureProceed": true,
|
||||||
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable"
|
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@ dependencies {
|
||||||
because('Starter para validação de dados')
|
because('Starter para validação de dados')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
implementation ('org.springframework.cloud:spring-cloud-starter-config') {
|
||||||
|
because('Starter para configuracao de ambiente')
|
||||||
|
}
|
||||||
|
|
||||||
// Biblioteca de codigo comum
|
// Biblioteca de codigo comum
|
||||||
implementation ('br.com.rayankonecny:hd-commons-lib:1.0.0') {
|
implementation ('br.com.rayankonecny:hd-commons-lib:1.0.0') {
|
||||||
because('Lib para compartilhar código comum entre os projetos')
|
because('Lib para compartilhar código comum entre os projetos')
|
||||||
|
|
@ -32,7 +36,7 @@ dependencies {
|
||||||
|
|
||||||
// Spring Security
|
// Spring Security
|
||||||
implementation ('org.springframework.boot:spring-boot-starter-security') {
|
implementation ('org.springframework.boot:spring-boot-starter-security') {
|
||||||
because('Starter para integrar com o Srping Security')
|
because('Starter para integrar com o Spring Security')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Json Web Token
|
// Json Web Token
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,21 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: "auth-service-api"
|
name: auth-service-api
|
||||||
data:
|
|
||||||
mongodb:
|
config:
|
||||||
uri: mongodb://175.15.15.6:27017/olympdb
|
import: optional:configserver:http://localhost:8888
|
||||||
auto-index-creation: true
|
|
||||||
aot:
|
logging:
|
||||||
enabled: false
|
level:
|
||||||
jwt.secret: "IHf3Yua/byvtA+iIcGWmkrLvpKEXTb5ClkXaZ0VDmYbr/6b1otCs38x68bidvZLAOB7anUtVQlCid6YDULO5XA=="
|
org.springframework.cloud.config: DEBUG
|
||||||
jwt.expiration: 120000
|
org.springframework.boot.context.config: DEBUG
|
||||||
jwt.expiration-sec.refresh-token: 3600
|
|
||||||
|
# data:
|
||||||
|
# mongodb:
|
||||||
|
# uri: mongodb://175.15.15.6:27017/olympdb
|
||||||
|
# auto-index-creation: true
|
||||||
|
# aot:
|
||||||
|
# enabled: false
|
||||||
|
# jwt.secret: "IHf3Yua/byvtA+iIcGWmkrLvpKEXTb5ClkXaZ0VDmYbr/6b1otCs38x68bidvZLAOB7anUtVQlCid6YDULO5XA=="
|
||||||
|
# jwt.expiration: 120000
|
||||||
|
# jwt.expiration-sec.refresh-token: 3600
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
CONFIG_SERVER_URI=https://forgeo-olymp.duckdns.org/rayankonecny/config-server
|
|
||||||
CONFIG_SERVER_USERNAME=rayankonecny
|
|
||||||
CONFIG_SERVER_PASSWORD=550919ca9d3411b0611d697f6acb6744e4510000
|
|
||||||
1
config-server/config-server
Submodule
1
config-server/config-server
Submodule
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2bfd3aed95fcc335d32112c5132d58c8459acaed
|
||||||
|
|
@ -13,12 +13,6 @@ ext {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
// Spring Boot Starters initial project
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter'
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
|
||||||
|
|
||||||
|
|
||||||
implementation 'org.springframework.cloud:spring-cloud-config-server'
|
implementation 'org.springframework.cloud:spring-cloud-config-server'
|
||||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cloud.config.server.EnableConfigServer;
|
import org.springframework.cloud.config.server.EnableConfigServer;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
@EnableConfigServer
|
@EnableConfigServer
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class ConfigServerApplication {
|
public class ConfigServerApplication {
|
||||||
|
|
@ -12,4 +14,10 @@ public class ConfigServerApplication {
|
||||||
SpringApplication.run(ConfigServerApplication.class, args);
|
SpringApplication.run(ConfigServerApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void debugEnv() {
|
||||||
|
System.out.println(System.getenv("CONFIG_SERVER_URI"));
|
||||||
|
System.out.println(System.getenv("CONFIG_SERVER_USERNAME"));
|
||||||
|
System.out.println(System.getenv("CONFIG_SERVER_PASSWORD"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,21 @@
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: 'config-server'
|
name: config-server
|
||||||
|
# profiles:
|
||||||
|
# active: dev
|
||||||
cloud:
|
cloud:
|
||||||
config:
|
config:
|
||||||
server:
|
server:
|
||||||
git:
|
git:
|
||||||
default-label: main
|
|
||||||
uri: ${CONFIG_SERVER_URI}
|
uri: ${CONFIG_SERVER_URI}
|
||||||
username: ${CONFIG_SERVER_USERNAME}
|
username: ${CONFIG_SERVER_USERNAME}
|
||||||
password: ${CONFIG_SERVER_PASSWORD}
|
password: ${CONFIG_SERVER_PASSWORD}
|
||||||
|
clone-on-start: true
|
||||||
|
default-label: main
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: ${PORT:8888}
|
port: ${PORT:8888}
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.springframework.cloud.config.server.environment: DEBUG
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ dependencies {
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||||
|
|
||||||
implementation 'org.springframework.cloud:spring-cloud-starter-config'
|
implementation 'org.springframework.cloud:spring-cloud-starter-config'
|
||||||
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
|
// implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
|
||||||
|
|
||||||
|
|
||||||
// Swagger / OpenAPI (compatível com Spring Boot 3.3.x)
|
// Swagger / OpenAPI (compatível com Spring Boot 3.3.x)
|
||||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
|
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,17 @@ package br.com.rayankonecny.userserviceapi;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class UserServiceApiApplication {
|
public class UserServiceApiApplication {
|
||||||
|
//
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(UserServiceApiApplication.class, args);
|
SpringApplication.run(UserServiceApiApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void debugMongo() {
|
||||||
|
System.out.println(System.getProperty("spring.data.mongodb.uri"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,11 @@
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
|
||||||
active: dev
|
|
||||||
application:
|
application:
|
||||||
name: 'user-service-api'
|
name: user-service-api
|
||||||
|
|
||||||
|
config:
|
||||||
|
import: optional:configserver:http://localhost:8888
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.springframework.cloud.config: DEBUG
|
||||||
|
org.springframework.boot.context.config: DEBUG
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
spring:
|
||||||
|
config:
|
||||||
|
import: optional:configserver:http://localhost:8888
|
||||||
4
user-service-api/src/main/resources/bootstrap.txt
Normal file
4
user-service-api/src/main/resources/bootstrap.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: user-service-api
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue