Skip to content

Instantly share code, notes, and snippets.

@latant
Last active December 16, 2020 15:38
Show Gist options
  • Save latant/f75f45be9d598d3956050360173ede72 to your computer and use it in GitHub Desktop.
Save latant/f75f45be9d598d3956050360173ede72 to your computer and use it in GitHub Desktop.
A Dockerfile for Neo4j plugin development with Gradle using caches for fast builds.
FROM gradle:6.7.1-jdk11 AS deps
ENV GRADLE_USER_HOME=/gradle-home
ADD ./settings.gradle.kts /neo4j-plugin/settings.gradle.kts
ADD ./build.gradle.kts /neo4j-plugin/build.gradle.kts
WORKDIR /neo4j-plugin
RUN gradle build
RUN ls -a /gradle-home
FROM gradle:6.7.1-jdk11 as build
ENV GRADLE_USER_HOME=/gradle-home
COPY --from=deps /gradle-home /gradle-home
COPY . /neo4j-plugin
WORKDIR /neo4j-plugin
RUN gradle shadowJar
FROM neo4j:4.2
COPY --from=build /neo4j-plugin/build/libs/*-all.jar /plugins/
ENV NEO4J_dbms_security_procedures_allowlist=example.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment