Skip to content
Merged
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
47 changes: 47 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Gradle
.gradle/
build/
gradle-app.setting
!gradle-wrapper.jar

# IDE
.idea/
.vscode/
*.iws
*.iml
*.ipr

# OS
.DS_Store
Thumbs.db

# Git
.git/
.gitignore

# Documentation
README.md
*.md

# Docker
Dockerfile*
docker-compose*.yml

# Monitoring
monitoring/

# Test files
src/test/

# Temporary files
*.tmp
*.log
*.pid
*.seed
*.pid.lock

# Node modules (if any)
node_modules/

Comment on lines +36 to +45
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Exclude secrets from the Docker build context.

Prevent accidental leakage of env files/keys into image layers.

Apply:

 # Temporary files
 *.tmp
 *.log
 *.pid
 *.seed
 *.pid.lock
+
+# Secrets
+.env
+.env.*
+**/*.pem
+**/*.key
+**/*_rsa
+**/*_ed25519
+**/*secret*
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Temporary files
*.tmp
*.log
*.pid
*.seed
*.pid.lock
# Node modules (if any)
node_modules/
# Temporary files
*.tmp
*.log
*.pid
*.seed
*.pid.lock
# Secrets
.env
.env.*
**/*.pem
**/*.key
**/*_rsa
**/*_ed25519
**/*secret*
# Node modules (if any)
node_modules/
🤖 Prompt for AI Agents
In .dockerignore around lines 36–45, the file currently ignores temp files and
node_modules but does not exclude environment files or secret keys; update the
Docker ignore entries to explicitly exclude secrets from the build context by
adding patterns such as .env, .env.*, *.key, *.pem, id_rsa*, .aws, .aws/*,
.git-credentials, .gpg, .secrets, secrets/, and any project-specific secret
filenames or directories so environment variables, private keys, and credential
files are not sent to Docker during build.

# Maven (if any)
target/
48 changes: 0 additions & 48 deletions .github/workflows/gemini-review.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@ build/

# Backup files
*.bak

bin/
bin/main/
bin/main/application.yml
bin/test/
bin/test/resources/
bin/test/resources/application.yml
bin/test/resources/application.yml.bak
bin/test/resources/application.yml.bak.bak
bin/test/resources/application.yml.bak.bak.bak
bin/test/resources/application.yml.bak.bak.bak.bak
bin/test/resources/application.yml.bak.bak.bak.bak.bak
24 changes: 15 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# 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
FROM gradle:8.3-jdk17 AS builder
WORKDIR /home/gradle/project
COPY . .
RUN gradle build --no-daemon -x test

# Runtime stage
FROM openjdk:17-slim
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

# Package stage
FROM openjdk:17-jdk-slim
WORKDIR /app
COPY --from=build /app/build/libs/*.jar /app/app.jar
COPY --from=builder /home/gradle/project/build/libs/*.jar app.jar

EXPOSE 8080
CMD ["java", "-jar", "/app/app.jar"]
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8080/actuator/health || exit 1

ENV JAVA_OPTS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0"
CMD ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]
Loading