Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Created May 10, 2021 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszkorecki/ca2786d0da26e653a9c80e54752f78dc to your computer and use it in GitHub Desktop.
Save lukaszkorecki/ca2786d0da26e653a9c80e54752f78dc to your computer and use it in GitHub Desktop.
FROM clojure:openjdk-11-lein-2.9.1 as builder
RUN mkdir -p /app
WORKDIR /app
COPY project.clj ./project.clj
RUN LEIN_SNAPSHOTS_IN_RELEASE=1 \
lein deps
COPY resources ./resources
COPY src ./src
# needs the following in project.clj: :uberjar-name "app-standalone.jar"
RUN LEIN_SNAPSHOTS_IN_RELEASE=1 lein uberjar && \
cp ./target/uberjar/app-standalone.jar ./app.jar
FROM openjdk:11.0.5-jre-slim-buster
WORKDIR /app
COPY --from=builder /app/app.jar .
CMD ["java", "-jar" , "/app/app.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment