I have a Spring Boot application that includes several application-XXX.properties
profiles. When I build Docker image using jib
, I notice that all these properties files are packaged in the image in /app/resouces
.
Is there a way to only include the main application.properties
and prevent including the specific properties for various profiles in the Docker image? This could potentially leak some sensitive details if left there.
Is this some jib
gradle configuration?
Don't include them in the folders packed to the JAR file. I suggest the following structure:
app
│
├── pom.xml
├── ext
│ └── application-localhost.properties
└── src
├── main
│ ├── java
│ │ └── ...
│ └── resources
│ └── application.properties
└── test
├── java
│ └── ...
└── resources
└── ...
src/main/resources
are the resources packed and delivered with the JAR.ext
are the resources specific to each environment (ex. localhost)
ext
directory as the resources for the local build.