Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
ssh -i private_key.pem -o StrictHostKeyChecking=no ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} "
sudo docker rm -f influy || true
cd /home/ubuntu
sudo docker-compose pull spring
sudo docker-compose up -d spring
docker compose pull spring
docker compose up -d spring
"
rm -f private_key.pem
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ application-prod.yml
._.DS_Store
**/.DS_Store

.env
.env

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build stage
FROM amazoncorretto:21 AS Builder
FROM amazoncorretto:21 AS builder

WORKDIR /app

Expand Down
24 changes: 14 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,46 +23,50 @@ repositories {
}

dependencies {
//JPA
// JPA
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

//Web
// Web
implementation 'org.springframework.boot:spring-boot-starter-web'

//Swagger
// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0'
implementation 'io.swagger.core.v3:swagger-annotations:2.2.25'

//Validation
// Validation
implementation 'org.springframework.boot:spring-boot-starter-validation'

//MySQL
// MySQL
runtimeOnly 'com.mysql:mysql-connector-j'

//Lombok
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

// redis
// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'

//springSecurity
// Spring security
implementation 'org.springframework.boot:spring-boot-starter-security'

//jwt
// Jwt
implementation 'io.jsonwebtoken:jjwt-api:0.12.6'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.6'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.6'

// s3
// S3
implementation 'software.amazon.awssdk:s3:2.31.40'

// AI
implementation platform("org.springframework.ai:spring-ai-bom:1.0.0-M3")
implementation 'org.springframework.ai:spring-ai-openai'

// Monitoring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
}

tasks.named('test') {
Expand Down
34 changes: 33 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ services:
- "8080:8080"
depends_on:
- redis
env_file: .env
env_file:
- .env

nginx:
image: nginx
Expand All @@ -28,3 +29,34 @@ services:
depends_on:
- spring

prometheus:
image: prom/prometheus
container_name: prometheus
ports:
- "9090:9090"
volumes:
- /home/ubuntu/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
depends_on:
- spring
restart: always

grafana:
image: grafana/grafana
container_name: grafana
ports:
- "3000:3000"
depends_on:
- prometheus
volumes:
- grafana-storage:/var/lib/grafana
restart: always

node-exporter:
image: prom/node-exporter
container_name: node-exporter
ports:
- "9100:9100"
restart: always

volumes:
grafana-storage:
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ protected boolean shouldNotFilter(HttpServletRequest request) throws ServletExce
String requestURI = request.getRequestURI();
String method = request.getMethod();

if (requestURI.startsWith("/grafana")) {
return true;
}

if ("GET".equalsIgnoreCase(method)) {
return Arrays.stream(SHOULD_NOT_FILTER_GET_LIST)
.anyMatch(pattern -> pathMatcher.match(pattern, requestURI));
Expand Down