Skip to content

Instantly share code, notes, and snippets.

View vvillschneider's full-sized avatar

William Schneider vvillschneider

View GitHub Profile
@vvillschneider
vvillschneider / Application.java
Last active January 28, 2022 02:24
Enabling BlockHound to identify blocking code
static {
BlockHound.install(builder -> {
builder.blockingMethodCallback(it -> {
new Error(it.toString()).printStackTrace();
});
});
}
@vvillschneider
vvillschneider / .gitignore
Created October 26, 2020 14:55
Gitignore file for Gradle/Intellij
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
/out/
@vvillschneider
vvillschneider / .editorconfig
Last active January 28, 2022 02:24
Intellij/Java Google code style
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = false
max_line_length = 100
tab_width = 2
ij_continuation_indent_size = 4
ij_formatter_off_tag = @formatter:off
@vvillschneider
vvillschneider / Dockerfile
Last active January 28, 2022 02:24
Multi-step Dockerfile for Java project with Gradle
FROM openjdk:17-oracle AS BUILD_IMAGE
ENV BASE_DIRECTORY=/app/
WORKDIR $BASE_DIRECTORY
COPY build.gradle settings.gradle gradlew $BASE_DIRECTORY
COPY gradle $BASE_DIRECTORY/gradle
RUN ./gradlew build --stacktrace || return 0
COPY src $BASE_DIRECTORY/src
RUN ./gradlew build --stacktrace
FROM openjdk:17-oracle
@vvillschneider
vvillschneider / Dockerfile
Last active January 28, 2022 02:24
Dockerfile for Java project with Gradle
FROM openjdk:17-oracle
ENV BASE_DIRECTORY=app
WORKDIR $BASE_DIRECTORY
COPY /build/libs/main-service.jar .
EXPOSE 8080
ENTRYPOINT ["java","-jar","main-service.jar"]