diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1d6fd43..ccb99da 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index c154318..49e3a5c 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,5 @@ application-prod.yml ._.DS_Store **/.DS_Store -.env \ No newline at end of file +.env + diff --git a/Dockerfile b/Dockerfile index 252b7f2..6ccc1df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # build stage -FROM amazoncorretto:21 AS Builder +FROM amazoncorretto:21 AS builder WORKDIR /app diff --git a/build.gradle b/build.gradle index abac535..b20340e 100644 --- a/build.gradle +++ b/build.gradle @@ -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') { diff --git a/docker-compose.yml b/docker-compose.yml index 9066603..3e8dd24 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,8 @@ services: - "8080:8080" depends_on: - redis - env_file: .env + env_file: + - .env nginx: image: nginx @@ -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: \ No newline at end of file diff --git a/src/main/java/com/influy/global/jwt/JwtAuthenticationFilter.java b/src/main/java/com/influy/global/jwt/JwtAuthenticationFilter.java index 4ade018..2e428ad 100644 --- a/src/main/java/com/influy/global/jwt/JwtAuthenticationFilter.java +++ b/src/main/java/com/influy/global/jwt/JwtAuthenticationFilter.java @@ -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));