-
Notifications
You must be signed in to change notification settings - Fork 0
set: 도커, 스프링부트 세팅 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Compiled class files | ||
| *.class | ||
|
|
||
| # Log files | ||
| *.log | ||
| logs/ | ||
|
|
||
| # BlueJ files | ||
| *.ctxt | ||
|
|
||
| # Mobile Tools for Java (J2ME) | ||
| .mtj.tmp/ | ||
|
|
||
| # Package Files # | ||
| *.jar | ||
| *.war | ||
| *.nar | ||
| *.ear | ||
| *.zip | ||
| *.tar.gz | ||
| *.rar | ||
|
|
||
| # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
| hs_err_pid* | ||
|
|
||
| # Build directory | ||
| target/ | ||
| out/ | ||
|
|
||
| # IDE configuration files | ||
| .idea/ | ||
| *.iml | ||
| *.ipr | ||
| *.iws | ||
| .classpath | ||
| .project | ||
| .settings/ | ||
| .DS_Store | ||
|
|
||
| # Gradle | ||
| .gradle/ | ||
| build/ | ||
|
|
||
| # Environment files | ||
| .env | ||
|
|
||
| # Temporary files | ||
| *.swp | ||
| *.tmp | ||
| *~ | ||
|
|
||
| # Backup files | ||
| *.bak | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Build stage | ||
| FROM gradle:8.3-jdk17-alpine AS build | ||
| WORKDIR /app | ||
| COPY build.gradle.kts settings.gradle.kts /app/ | ||
| COPY src /app/src | ||
| RUN gradle build --no-daemon | ||
|
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainBuild will fail: copying .kts files while repo uses Groovy DSL Repo contains -COPY build.gradle.kts settings.gradle.kts /app/
+COPY build.gradle settings.gradle /app/
COPY src /app/src
-RUN gradle build --no-daemon
+RUN gradle build --no-daemonIf you actually use Kotlin DSL, rename files consistently and update this Dockerfile. 🏁 Script executed: #!/bin/bash
echo "Locating Gradle build and settings files..."
find . -maxdepth 2 -type f -name "settings.gradle*" -print
find . -maxdepth 2 -type f -name "build.gradle*" -printLength of output: 248 Align Dockerfile with Groovy DSL filenames -COPY build.gradle.kts settings.gradle.kts /app/
+COPY build.gradle settings.gradle /app/🤖 Prompt for AI Agents |
||
|
|
||
| # Package stage | ||
| FROM openjdk:17-jdk-slim | ||
| WORKDIR /app | ||
| COPY --from=build /app/build/libs/*.jar /app/app.jar | ||
| EXPOSE 8080 | ||
| CMD ["java", "-jar", "/app/app.jar"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| plugins { | ||
| id 'org.springframework.boot' version '3.1.4' | ||
| id 'io.spring.dependency-management' version '1.1.3' | ||
| id 'java' | ||
| } | ||
|
|
||
| group = 'com.example' | ||
| version = '0.0.1-SNAPSHOT' | ||
|
|
||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
| implementation 'org.springframework.boot:spring-boot-starter-web' | ||
| implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2' | ||
| implementation 'org.springframework.boot:spring-boot-starter-data-redis' | ||
| compileOnly 'org.projectlombok:lombok' | ||
| developmentOnly 'org.springframework.boot:spring-boot-devtools' | ||
| runtimeOnly 'org.postgresql:postgresql' | ||
| annotationProcessor 'org.projectlombok:lombok' | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
| testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
|
|
||
| } | ||
|
|
||
| tasks.named('test') { | ||
| useJUnitPlatform() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| services: | ||
| postgres: | ||
| image: postgres:16 | ||
| container_name: postgres | ||
| ports: | ||
| - "5432:5432" | ||
| environment: | ||
| - POSTGRES_USER=bitly | ||
| - POSTGRES_PASSWORD=bitly | ||
| - POSTGRES_DB=bitly | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U bitly -d bitly"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 5 | ||
| deploy: | ||
| resources: | ||
| limits: | ||
| memory: 512M | ||
|
|
||
| redis: | ||
| image: redis:7-alpine | ||
| container_name: redis | ||
| ports: | ||
| - "6379:6379" | ||
| command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru | ||
| healthcheck: | ||
| test: ["CMD", "redis-cli", "ping"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 5 | ||
| deploy: | ||
| resources: | ||
| limits: | ||
| memory: 1G | ||
|
|
||
| # api: | ||
| # build: . | ||
| # container_name: api | ||
| # depends_on: | ||
| # postgres: | ||
| # condition: service_healthy | ||
| # redis: | ||
| # condition: service_healthy | ||
| # ports: | ||
| # - "8080:8080" | ||
| # environment: | ||
| # - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/bitly | ||
| # - SPRING_DATASOURCE_USERNAME=bitly | ||
| # - SPRING_DATASOURCE_PASSWORD=bitly | ||
| # - SPRING_REDIS_HOST=redis | ||
| # - SPRING_REDIS_PORT=6379 | ||
| # deploy: | ||
| # resources: | ||
| # limits: | ||
| # memory: 1G |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainPin Gradle distribution SHA-256 to prevent supply‑chain tampering. Run to fetch the checksum and verify it locally, then add it: Then update the wrapper properties: distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
+distributionSha256Sum=<paste-verified-sha256>🏁 Script executed: #!/bin/bash
url='https://services.gradle.org/distributions/gradle-8.14.2-bin.zip'
curl -fsSL "$url.sha256"
# Optional: verify after download
curl -fsSLO "$url" && curl -fsSL "$url.sha256" | sha256sum -c -Length of output: 527 Pin Gradle distribution SHA-256 Add it to gradle/wrapper/gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
+distributionSha256Sum=7197a12f450794931532469d4ff21a59ea2c1cd59a3ec3f89c035c3c420a6999🤖 Prompt for AI Agents |
||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Don’t ignore Gradle wrapper jar
*.jarwill excludegradle/wrapper/gradle-wrapper.jar, breaking the wrapper. Whitelist it.# Gradle .gradle/ build/ +!gradle/wrapper/gradle-wrapper.jar🤖 Prompt for AI Agents